v1.0.0 as default version

pull/227/head
iwilltry42 5 years ago
parent 0a8eca31f5
commit 52b23adec9
  1. 5
      cmd/create/createCluster.go
  2. 5
      version/version.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...]]`")

@ -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 {

Loading…
Cancel
Save