From fe9eb1ba46e7402efb84772eb5396262f195fd2c Mon Sep 17 00:00:00 2001 From: Amim Knabben Date: Sat, 25 Apr 2020 21:41:26 -0400 Subject: [PATCH] Migrating Kubelet testing flags to configuration --- cmd/kubelet/app/options/options.go | 8 ++++---- pkg/kubelet/apis/config/types.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/kubelet/app/options/options.go b/cmd/kubelet/app/options/options.go index b34c693e5f9..88eee5caa85 100644 --- a/cmd/kubelet/app/options/options.go +++ b/cmd/kubelet/app/options/options.go @@ -346,9 +346,6 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) { "On success, a kubeconfig file referencing the generated client certificate and key is written to the path specified by --kubeconfig. "+ "The client certificate and key file will be stored in the directory pointed by --cert-dir.") - fs.BoolVar(&f.ReallyCrashForTesting, "really-crash-for-testing", f.ReallyCrashForTesting, "If true, when panics occur crash. Intended for testing.") - fs.Float64Var(&f.ChaosChance, "chaos-chance", f.ChaosChance, "If > 0.0, introduce random client errors and latency. Intended for testing.") - fs.BoolVar(&f.EnableServer, "enable-server", f.EnableServer, "Enable the Kubelet's server") fs.StringVar(&f.HostnameOverride, "hostname-override", f.HostnameOverride, "If non-empty, will use this string as identification instead of the actual hostname. If --cloud-provider is set, the cloud provider determines the name of the node (consult cloud provider documentation to determine if and how the hostname is used).") @@ -405,7 +402,10 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) { fs.BoolVar(&f.EnableCAdvisorJSONEndpoints, "enable-cadvisor-json-endpoints", f.EnableCAdvisorJSONEndpoints, "Enable cAdvisor json /spec and /stats/* endpoints. [default=false]") // TODO: Remove this flag in 1.20+. https://github.com/kubernetes/kubernetes/issues/68522 fs.MarkDeprecated("enable-cadvisor-json-endpoints", "will be removed in a future version") - + fs.BoolVar(&f.ReallyCrashForTesting, "really-crash-for-testing", f.ReallyCrashForTesting, "If true, when panics occur crash. Intended for testing.") + fs.MarkDeprecated("really-crash-for-testing", "will be removed in a future version.") + fs.Float64Var(&f.ChaosChance, "chaos-chance", f.ChaosChance, "If > 0.0, introduce random client errors and latency. Intended for testing.") + fs.MarkDeprecated("chaos-chance", "will be removed in a future version.") } // AddKubeletConfigFlags adds flags for a specific kubeletconfig.KubeletConfiguration to the specified FlagSet diff --git a/pkg/kubelet/apis/config/types.go b/pkg/kubelet/apis/config/types.go index fa27e5f6398..1fb797d07da 100644 --- a/pkg/kubelet/apis/config/types.go +++ b/pkg/kubelet/apis/config/types.go @@ -405,7 +405,7 @@ type KubeletWebhookAuthentication struct { CacheTTL metav1.Duration } -// KubeletAnonymousAuthentication enables anonymous requests to the kubetlet server. +// KubeletAnonymousAuthentication enables anonymous requests to the kubelet server. type KubeletAnonymousAuthentication struct { // enabled allows anonymous requests to the kubelet server. // Requests that are not rejected by another authentication method are treated as anonymous requests.