Merge pull request #99823 from navidshaikh/pr/slog-k-utils

Migrate pkg/kubelet/util to structured logging
This commit is contained in:
Kubernetes Prow Robot 2021-03-08 16:27:28 -08:00 committed by GitHub
commit b4f351329e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -313,7 +313,7 @@ func (c *objectCache) Get(namespace, name string) (runtime.Object, error) {
if c.isImmutable(object) {
item.setImmutable()
if item.stop() {
klog.V(4).Infof("Stopped watching for changes of %q/%q - object is immutable", namespace, name)
klog.V(4).InfoS("Stopped watching for changes - object is immutable", "obj", klog.KRef(namespace, name))
}
}
return object, nil

View File

@ -46,7 +46,7 @@ func SetNodeOwnerFunc(c clientset.Interface, nodeName string) func(lease *coordi
},
}
} else {
klog.Errorf("failed to get node %q when trying to set owner ref to the node lease: %v", nodeName, err)
klog.ErrorS(err, "Failed to get node when trying to set owner ref to the node lease", "node", klog.KRef("", nodeName))
return err
}
}

View File

@ -100,7 +100,7 @@ func parseEndpointWithFallbackProtocol(endpoint string, fallbackProtocol string)
fallbackEndpoint := fallbackProtocol + "://" + endpoint
protocol, addr, err = parseEndpoint(fallbackEndpoint)
if err == nil {
klog.Warningf("Using %q as endpoint is deprecated, please consider using full url format %q.", endpoint, fallbackEndpoint)
klog.InfoS("Using this endpoint is deprecated, please consider using full URL format", "endpoint", endpoint, "URL", fallbackEndpoint)
}
}
return