class KubernetesCli < Formula desc "Kubernetes command-line interface" homepage "http://kubernetes.io/" url "https://github.com/kubernetes/kubernetes/archive/v1.4.1.tar.gz" sha256 "197590dc4c8c23f5290822bda2c97ac3cf8d7eba43637f8103cd37d99072d55e" head "https://github.com/kubernetes/kubernetes.git" bottle do cellar :any_skip_relocation sha256 "a29cb19a1bdf80dc9a693bc9b7b4c42bb36fc84cec6486f33cce2e77e51bba24" => :sierra sha256 "b98ae46a94d059829d6f9ddd9c42df5f35d2f4bba494144d95f043375be1a8df" => :el_capitan sha256 "71d29d2c444e77bcabbb2545a891c2a76d83fcadeac8b41c07e09d9627747045" => :yosemite end depends_on "go" => :build def install # Patch needed to avoid vendor dependency on github.com/jteeuwen/go-bindata # Build will otherwise fail with missing dep # Raised in https://github.com/kubernetes/kubernetes/issues/34067 rm "./test/e2e/framework/gobindata_util.go" # Race condition still exists in OSX Yosemite # Filed issue: https://github.com/kubernetes/kubernetes/issues/34635 ENV.deparallelize { system "make", "generated_files" } system "make", "kubectl", "GOFLAGS=-v" arch = MacOS.prefer_64_bit? ? "amd64" : "x86" bin.install "_output/local/bin/darwin/#{arch}/kubectl" output = Utils.popen_read("#{bin}/kubectl completion bash") (bash_completion/"kubectl").write output end test do output = shell_output("#{bin}/kubectl 2>&1") assert_match "kubectl controls the Kubernetes cluster manager.", output end end