Skip to content

Commit

Permalink
adjust logging for token refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
jessieqliu committed Sep 24, 2024
1 parent 6ac1b7f commit 6912fda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion launcher/container_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ func (r *ContainerRunner) measureMemoryMonitor() error {
// to wait before attemping to refresh it.
// The token file will be written to a tmp file and then renamed.
func (r *ContainerRunner) refreshToken(ctx context.Context) (time.Duration, error) {
r.logger.Info("refreshing attestation verifier OIDC token")
if err := r.attestAgent.Refresh(ctx); err != nil {
return 0, fmt.Errorf("failed to refresh attestation agent: %v", err)
}
Expand Down Expand Up @@ -402,6 +401,7 @@ func (r *ContainerRunner) refreshToken(ctx context.Context) (time.Duration, erro
if err != nil {
return 0, fmt.Errorf("failed to format claims: %w", err)
}
r.logger.Info("successfully refreshed attestation token")
r.logger.Info(string(claimsString))

return getNextRefreshFromExpiration(time.Until(claims.ExpiresAt.Time), rand.Float64()), nil
Expand Down Expand Up @@ -434,6 +434,7 @@ func (r *ContainerRunner) fetchAndWriteTokenWithRetry(ctx context.Context,
r.logger.Info("token refreshing stopped")
return
case <-timer.C:
r.logger.Info("refreshing attestation verifier OIDC token")
var duration time.Duration
// Refresh token with default retry policy.
err := backoff.RetryNotify(
Expand Down

0 comments on commit 6912fda

Please sign in to comment.