Skip to content

Instantly share code, notes, and snippets.

@ingarabr
Last active September 27, 2019 17:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ingarabr/1a8cd73cac8ac36c1d1050e9438a2a8c to your computer and use it in GitHub Desktop.
Save ingarabr/1a8cd73cac8ac36c1d1050e9438a2a8c to your computer and use it in GitHub Desktop.

Install old versions of kubernetes helm

The formula above is based on kubernetes-helm.rb 2.11.0

Unlink the current version if it exist

brew unlink kubernetes-helm

Install the old version (2.11.0)

brew install <raw link from this gist>

Change between installed versions

  • brew switch kubernetes-helm to list out available versions
  • brew switch kubernetes-helm <version> to switch to it
class KubernetesHelm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/helm/helm.git",
:tag => "v2.11.0",
:revision => "2e55dbe1fdb5fdb96b75ff144a339489417b146b"
head "https://github.com/helm/helm.git"
bottle do
cellar :any_skip_relocation
sha256 "68294dc3abb779233fdbfa14648aaa06ea78ff63b7484716d39ed8b280d4a18a" => :high_sierra
sha256 "c5c53af3256aa619058e7ab1d265ed4fb54d7dacc80a455de7df6e43176da310" => :sierra
sha256 "987174d800b65c9350e198152cf05a5f605f49149da382d81c39b8e6da2c97e5" => :el_capitan
end
depends_on "glide" => :build
depends_on "go" => :build
depends_on "mercurial" => :build
def install
ENV["GOPATH"] = buildpath
ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}"
ENV.prepend_create_path "PATH", buildpath/"bin"
arch = "amd64"
ENV["TARGETS"] = "darwin/#{arch}"
dir = buildpath/"src/k8s.io/helm"
dir.install buildpath.children - [buildpath/".brew_home"]
cd dir do
system "make", "bootstrap"
system "make", "build"
bin.install "bin/helm"
bin.install "bin/tiller"
man1.install Dir["docs/man/man1/*"]
bash_completion.install "scripts/completions.bash" => "helm"
prefix.install_metafiles
end
end
test do
system "#{bin}/helm", "create", "foo"
assert File.directory? "#{testpath}/foo/charts"
version_output = shell_output("#{bin}/helm version --client 2>&1")
assert_match "GitTreeState:\"clean\"", version_output
assert_match stable.instance_variable_get(:@resource).instance_variable_get(:@specs)[:revision], version_output if build.stable?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment