Merge pull request #99264 from palnabarun/structured-logging-pkg/kubelet/token

Migrate pkg/kubelet/token to structured logging
This commit is contained in:
Kubernetes Prow Robot 2021-03-08 19:23:11 -08:00 committed by GitHub
commit 9a1b5bb255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,7 +118,7 @@ func (m *Manager) GetServiceAccountToken(namespace, name string, tr *authenticat
case m.expired(ctr):
return nil, fmt.Errorf("token %s expired and refresh failed: %v", key, err)
default:
klog.Errorf("couldn't update token %s: %v", key, err)
klog.ErrorS(err, "Couldn't update token", "cacheKey", key)
return ctr, nil
}
}
@ -172,7 +172,7 @@ func (m *Manager) requiresRefresh(tr *authenticationv1.TokenRequest) bool {
if tr.Spec.ExpirationSeconds == nil {
cpy := tr.DeepCopy()
cpy.Status.Token = ""
klog.Errorf("expiration seconds was nil for tr: %#v", cpy)
klog.ErrorS(nil, "Expiration seconds was nil for token request", "tokenRequest", cpy)
return false
}
now := m.clock.Now()