Skip to content

Commit

Permalink
Merge pull request #5415 from twz123/confine-kubelet-root-dir
Browse files Browse the repository at this point in the history
Narrow down kubelet-root-dir flag
  • Loading branch information
twz123 authored Jan 8, 2025
2 parents 0c4f33e + 41c2fab commit 960b539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmd/reset/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ func NewResetCmd() *cobra.Command {
},
}
cmd.PersistentFlags().AddFlagSet(config.GetPersistentFlagSet())
cmd.Flags().AddFlagSet(config.GetCriSocketFlag())
cmd.Flags().AddFlagSet(config.FileInputFlag())

flags := cmd.Flags()
flags.AddFlagSet(config.GetCriSocketFlag())
flags.AddFlagSet(config.FileInputFlag())
flags.String("kubelet-root-dir", "", "Kubelet root directory for k0s")

return cmd
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ func GetPersistentFlagSet() *pflag.FlagSet {
flagset.BoolVarP(&Debug, "debug", "d", false, "Debug logging (default: false)")
flagset.BoolVarP(&Verbose, "verbose", "v", false, "Verbose logging (default: false)")
flagset.String("data-dir", constant.DataDirDefault, "Data Directory for k0s. DO NOT CHANGE for an existing setup, things will break!")
flagset.String("kubelet-root-dir", "", "Kubelet root directory for k0s")
flagset.StringVar(&StatusSocket, "status-socket", "", "Full file path to the socket file. (default: <rundir>/status.sock)")
flagset.StringVar(&DebugListenOn, "debugListenOn", ":6060", "Http listenOn for Debug pprof handler")
return flagset
Expand Down Expand Up @@ -234,6 +233,7 @@ func GetWorkerFlags() *pflag.FlagSet {
workerOpts.LogLevels = DefaultLogLevels()
}

flagset.String("kubelet-root-dir", "", "Kubelet root directory for k0s")
flagset.StringVar(&workerOpts.WorkerProfile, "profile", "default", "worker profile to use on the node")
flagset.StringVar(&workerOpts.CIDRRange, "cidr-range", "10.96.0.0/12", "HACK: cidr range for the windows worker node")
flagset.BoolVar(&workerOpts.CloudProvider, "enable-cloud-provider", false, "Whether or not to enable cloud provider support in kubelet")
Expand Down

0 comments on commit 960b539

Please sign in to comment.