Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Vince Prignano <vince@prigna.com>
  • Loading branch information
AndiDog and vincepri committed Jan 15, 2024
1 parent 6fa9f49 commit 563213a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,8 @@ func (r *KubeadmConfigReconciler) refreshBootstrapTokenIfNeeded(ctx context.Cont
// Extend TTL for existing token
newExpiration := time.Now().UTC().Add(r.TokenTTL).Format(time.RFC3339)
secret.Data[bootstrapapi.BootstrapTokenExpirationKey] = []byte(newExpiration)
log.Info("Refreshing token until the infrastructure has a chance to consume it", "oldExpiration", secretExpiration, "newExpiration", newExpiration)
err = remoteClient.Update(ctx, secret)
if err != nil {
log.Info("Bootstrap data hasn't yet been consumed by an infrastructure provider; refreshing token", "oldExpiration", secretExpiration, "newExpiration", newExpiration)
if err := remoteClient.Update(ctx, secret); err != nil {
return ctrl.Result{}, errors.Wrapf(err, "failed to refresh bootstrap token")
}
return ctrl.Result{
Expand Down

0 comments on commit 563213a

Please sign in to comment.