cluster/tools: integrate kartongips as main kubecfg tool
Change-Id: If6a6c8e9c9163f0fc25adcaa8680857fdca69cd3
diff --git a/cluster/tools/BUILD b/cluster/tools/BUILD
index d26f668..141fff7 100644
--- a/cluster/tools/BUILD
+++ b/cluster/tools/BUILD
@@ -9,7 +9,7 @@
copy_go_binary(
name = "kubecfg",
- src = "@com_github_bitnami_kubecfg//:kubecfg",
+ src = "//cluster/tools/kartongips",
visibility = ["//visibility:public"],
)
diff --git a/cluster/tools/kartongips/BUILD.bazel b/cluster/tools/kartongips/BUILD.bazel
index ef295cf..1a08ee2 100644
--- a/cluster/tools/kartongips/BUILD.bazel
+++ b/cluster/tools/kartongips/BUILD.bazel
@@ -5,6 +5,9 @@
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/cluster/tools/kartongips",
visibility = ["//visibility:private"],
+ x_defs = {
+ "code.hackerspace.pl/hscloud/cluster/tools/kartongips.Version": "{STABLE_GIT_VERSION}",
+ },
deps = [
"//cluster/tools/kartongips/cmd:go_default_library",
"//cluster/tools/kartongips/pkg/kubecfg:go_default_library",
diff --git a/cluster/tools/kartongips/cmd/version.go b/cluster/tools/kartongips/cmd/version.go
index fb9b7eb..7644fb9 100644
--- a/cluster/tools/kartongips/cmd/version.go
+++ b/cluster/tools/kartongips/cmd/version.go
@@ -20,7 +20,6 @@
jsonnet "github.com/google/go-jsonnet"
"github.com/spf13/cobra"
- "k8s.io/client-go/pkg/version"
)
func init() {
@@ -28,7 +27,7 @@
}
// Version is overridden by main
-var Version = "(dev build)"
+var Version = "unknown (external)"
var versionCmd = &cobra.Command{
Use: "version",
@@ -36,8 +35,8 @@
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
out := cmd.OutOrStdout()
- fmt.Fprintln(out, "kubecfg version:", Version)
+ fmt.Fprintln(out, "kartongips, a fork of github.com/bitnami/kubecfg")
+ fmt.Fprintln(out, "hscloud version:", Version)
fmt.Fprintln(out, "jsonnet version:", jsonnet.Version())
- fmt.Fprintln(out, "client-go version:", version.Get())
},
}
diff --git a/cluster/tools/kartongips/main.go b/cluster/tools/kartongips/main.go
index 11058b3..2dd10dd 100644
--- a/cluster/tools/kartongips/main.go
+++ b/cluster/tools/kartongips/main.go
@@ -24,11 +24,10 @@
"code.hackerspace.pl/hscloud/cluster/tools/kartongips/pkg/kubecfg"
)
-// Version is overridden using `-X main.version` during release builds
-var version = "(dev build)"
+var Version = "unknown"
func main() {
- cmd.Version = version
+ cmd.Version = Version
if err := cmd.RootCmd.Execute(); err != nil {
// PersistentPreRunE may not have been run for early