migrate pkg/kubelet/token to structured logging

Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
This commit is contained in:
Nabarun Pal 2021-02-20 16:21:28 +05:30
parent 03b0ec955a
commit b009a12f61
No known key found for this signature in database
GPG Key ID: 611D5079D826B150

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()