diff --git a/cmd/controller/controller_test.go b/cmd/controller/controller_test.go index 0b7b1ccfec74..41b0775e115a 100644 --- a/cmd/controller/controller_test.go +++ b/cmd/controller/controller_test.go @@ -52,7 +52,7 @@ Flags: --cidr-range string HACK: cidr range for the windows worker node \(default "10\.96\.0\.0/12"\) -c, --config string config file, use '-' to read the config from stdin \(default ".+k0s\.yaml"\) --cri-socket string container runtime socket to use, default to internal containerd\. Format: \[remote\|docker\]:\[path-to-socket\] - --data-dir string Data Directory for k0s \(default: .+k0s\)\. DO NOT CHANGE for an existing setup, things will break! + --data-dir string Data Directory for k0s\. DO NOT CHANGE for an existing setup, things will break! \(default ".+k0s"\) -d, --debug Debug logging \(default: false\) --debugListenOn string Http listenOn for Debug pprof handler \(default ":6060"\) --disable-components strings disable components \(valid items: applier-manager,autopilot,control-api,coredns,csr-approver,endpoint-reconciler,helm,konnectivity-server,kube-controller-manager,kube-proxy,kube-scheduler,metrics-server,network-provider,node-role,system-rbac,windows-node,worker-config\) diff --git a/cmd/install/controller_test.go b/cmd/install/controller_test.go index a2f22de44ede..60f0875d9ebc 100644 --- a/cmd/install/controller_test.go +++ b/cmd/install/controller_test.go @@ -51,7 +51,7 @@ Flags: --cidr-range string HACK: cidr range for the windows worker node \(default "10\.96\.0\.0/12"\) -c, --config string config file, use '-' to read the config from stdin \(default ".+k0s\.yaml"\) --cri-socket string container runtime socket to use, default to internal containerd\. Format: \[remote\|docker\]:\[path-to-socket\] - --data-dir string Data Directory for k0s \(default: .+k0s\)\. DO NOT CHANGE for an existing setup, things will break! + --data-dir string Data Directory for k0s\. DO NOT CHANGE for an existing setup, things will break! \(default ".+k0s"\) -d, --debug Debug logging \(default: false\) --debugListenOn string Http listenOn for Debug pprof handler \(default ":6060"\) --disable-components strings disable components \(valid items: applier-manager,autopilot,control-api,coredns,csr-approver,endpoint-reconciler,helm,konnectivity-server,kube-controller-manager,kube-proxy,kube-scheduler,metrics-server,network-provider,node-role,system-rbac,windows-node,worker-config\) diff --git a/pkg/config/cli.go b/pkg/config/cli.go index 9d565b0a2bf1..d2f8696a87c5 100644 --- a/pkg/config/cli.go +++ b/pkg/config/cli.go @@ -34,7 +34,6 @@ import ( var ( CfgFile string - DataDir string Debug bool DebugListenOn string StatusSocket string @@ -124,7 +123,7 @@ func GetPersistentFlagSet() *pflag.FlagSet { flagset := &pflag.FlagSet{} flagset.BoolVarP(&Debug, "debug", "d", false, "Debug logging (default: false)") flagset.BoolVarP(&Verbose, "verbose", "v", false, "Verbose logging (default: false)") - flagset.StringVar(&DataDir, "data-dir", "", "Data Directory for k0s (default: /var/lib/k0s). DO NOT CHANGE for an existing setup, things will break!") + flagset.String("data-dir", constant.DataDirDefault, "Data Directory for k0s. DO NOT CHANGE for an existing setup, things will break!") flagset.StringVar(&StatusSocket, "status-socket", "", "Full file path to the socket file. (default: /status.sock)") flagset.StringVar(&DebugListenOn, "debugListenOn", ":6060", "Http listenOn for Debug pprof handler") return flagset @@ -139,7 +138,7 @@ func GetKubeCtlFlagSet() *pflag.FlagSet { } flagset := &pflag.FlagSet{} - flagset.StringVar(&DataDir, "data-dir", "", "Data Directory for k0s (default: /var/lib/k0s). DO NOT CHANGE for an existing setup, things will break!") + flagset.String("data-dir", constant.DataDirDefault, "Data Directory for k0s. DO NOT CHANGE for an existing setup, things will break!") flagset.BoolVar(&Debug, "debug", debugDefault, "Debug logging [$DEBUG]") return flagset }