Skip to content

Commit

Permalink
Vcluster 0.12.3
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanBrushett committed Nov 25, 2022
1 parent ef4ab4c commit 888fa91
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions vcluster.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Vcluster < Formula
desc "Creates fully functional virtual k8s cluster inside host k8s cluster's namespace"
homepage "https://www.vcluster.com"
url "https://github.com/loft-sh/vcluster.git",
tag: "v0.12.3",
revision: "397d9942f6f05ba7ca1dc9d507f26c8e33cd36b4"
license "Apache-2.0"

depends_on "go" => :build
depends_on "helm"
depends_on "kubernetes-cli"

conflicts_with "homebrew/core/vcluster"

def install
ldflags = %W[
-s -w
-X main.commitHash=#{Utils.git_head}
-X main.buildDate=#{time.iso8601}
-X main.version=#{version}
]
system "go", "build", "-mod", "vendor", *std_go_args(ldflags: ldflags), "./cmd/vclusterctl/main.go"
end

test do
help_output = "vcluster root command"
assert_match help_output, shell_output("#{bin}/vcluster --help")

create_output = "there is an error loading your current kube config " \
"(invalid configuration: no configuration has been provided, " \
"try setting KUBERNETES_MASTER environment variable), " \
"please make sure you have access to a kubernetes cluster and the command " \
"`kubectl get namespaces` is working"
assert_match create_output, shell_output("#{bin}/vcluster create vcluster -n vcluster --create-namespace", 1)
end
end

0 comments on commit 888fa91

Please sign in to comment.