diff --git a/cmd/create/createCluster.go b/cmd/create/createCluster.go index 40365d30..986900c7 100644 --- a/cmd/create/createCluster.go +++ b/cmd/create/createCluster.go @@ -30,6 +30,7 @@ import ( k3dCluster "github.com/rancher/k3d/pkg/cluster" "github.com/rancher/k3d/pkg/runtimes" k3d "github.com/rancher/k3d/pkg/types" + "github.com/rancher/k3d/version" log "github.com/sirupsen/logrus" ) @@ -54,11 +55,11 @@ func NewCmdCreateCluster() *cobra.Command { /********* * Flags * *********/ - cmd.Flags().StringArrayP("api-port", "a", []string{"6443"}, "Specify the Kubernetes API server port (Format: `--api-port [HOST:]HOSTPORT[@NODEFILTER]`") // TODO: how to handle this for multi-master setups? + cmd.Flags().StringArrayP("api-port", "a", []string{"6443"}, "Specify the Kubernetes API server port (Format: `--api-port [HOST:]HOSTPORT[@NODEFILTER]`") cmd.Flags().IntP("masters", "m", 1, "Specify how many masters you want to create") cmd.Flags().IntP("workers", "w", 0, "Specify how many workers you want to create") // cmd.Flags().String("config", "", "Specify a cluster configuration file") // TODO: to implement - cmd.Flags().String("image", fmt.Sprintf("%s:%s", k3d.DefaultK3sImageRepo, "v1.0.0"), "Specify k3s image that you want to use for the nodes") // TODO: get image version + cmd.Flags().String("image", fmt.Sprintf("%s:%s", k3d.DefaultK3sImageRepo, version.K3sVersion), "Specify k3s image that you want to use for the nodes") cmd.Flags().String("network", "", "Join an existing network") cmd.Flags().String("secret", "", "Specify a cluster secret. By default, we generate one.") cmd.Flags().StringArrayP("volume", "v", nil, "Mount volumes into the nodes (Format: `--volume [SOURCE:]DEST[@NODEFILTER[;NODEFILTER...]]`") diff --git a/version/version.go b/version/version.go index 52b3a0b7..771fb214 100644 --- a/version/version.go +++ b/version/version.go @@ -24,8 +24,9 @@ package version // Version is the string that contains version var Version string -// K3sVersion contains the latest version tag of K3s -var K3sVersion = "latest" +// K3sVersion should contain the latest version tag of k3s (hardcoded at build time) +// we're setting a default version v1.0.0, because it's stable and because the 'latest' tag is not actively maintained +var K3sVersion = "v1.0.0" // TODO: can we try to dynamically fetch the latest version at runtime and only fallback to this if it fails? // GetVersion returns the version for cli, it gets it from "git describe --tags" or returns "dev" when doing simple go build func GetVersion() string {