Skip to content

Commit

Permalink
migrate pkg/kubelet/token to structured logging
Browse files Browse the repository at this point in the history
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
  • Loading branch information
palnabarun committed Mar 5, 2021
1 parent 03b0ec9 commit b009a12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kubelet/token/token_manager.go
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b009a12

Please sign in to comment.