Merge pull request #97000 from mlevesquedion/avoid-logging-headers

Avoid logging headers from kubelet configuration
This commit is contained in:
Kubernetes Prow Robot 2021-03-04 13:38:22 -08:00 committed by GitHub
commit 983cac7f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,8 +263,15 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
// set up signal context here in order to be reused by kubelet and docker shim
ctx := genericapiserver.SetupSignalContext()
// make the kubelet's config safe for logging
config := kubeletServer.KubeletConfiguration.DeepCopy()
for k := range config.StaticPodURLHeader {
config.StaticPodURLHeader[k] = []string{"<masked>"}
}
// log the kubelet's config for inspection
klog.V(5).Infof("KubeletConfiguration: %#v", config)
// run the kubelet
klog.V(5).Infof("KubeletConfiguration: %#v", kubeletServer.KubeletConfiguration)
if err := Run(ctx, kubeletServer, kubeletDeps, utilfeature.DefaultFeatureGate); err != nil {
klog.Fatal(err)
}