mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Kubelet flags take precedence over config from files/ConfigMaps
Changes the Kubelet configuration flag precedence order so that flags take precedence over config from files/ConfigMaps. See issue #56171 for more details. Also modifies e2e node test suite to transform all relevant Kubelet flags into a config file before starting tests when the KubeletConfigFile feature gate is true, and turns on the KubeletConfigFile gate for all e2e node tests. This allows the alpha dynamic Kubelet config feature to continue to work in tests after the precedence change.
This commit is contained in:
@@ -53,7 +53,7 @@ func main() {
|
||||
}
|
||||
options.AddKubeletConfigFlags(pflag.CommandLine, defaultConfig)
|
||||
|
||||
// parse the command line flags into the respective objects
|
||||
// initialize pflag and parse the initial command line flags into the respective objects
|
||||
flag.InitFlags()
|
||||
|
||||
// initialize logging and defer flush
|
||||
@@ -80,6 +80,12 @@ func main() {
|
||||
die(err)
|
||||
}
|
||||
|
||||
// re-parse the command-line flags on top of the returned configuration
|
||||
// we layer flags over file-based and remote configuration to
|
||||
// preserve backwards compatibility across binary upgrades
|
||||
// see issue #56171 for more details
|
||||
pflag.Parse()
|
||||
|
||||
// construct a KubeletServer from kubeletFlags and kubeletConfig
|
||||
kubeletServer := &options.KubeletServer{
|
||||
KubeletFlags: *kubeletFlags,
|
||||
|
||||
Reference in New Issue
Block a user