Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDog committed Jan 15, 2024
1 parent 6ef10f3 commit 6fa9f49
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ func (r *KubeadmConfigReconciler) refreshBootstrapTokenIfNeeded(ctx context.Cont
if secretExpiration == "" {
log.Info(fmt.Sprintf("Token has no valid value for %s, writing new expiration timestamp", bootstrapapi.BootstrapTokenExpirationKey))
} else {
// Assuming UTC, since we create the label value with that timezone
expiration, err := time.Parse(time.RFC3339, secretExpiration)
if err != nil {
return ctrl.Result{}, errors.Wrapf(err, "can't parse expiration time of bootstrap token")
Expand Down Expand Up @@ -851,7 +852,7 @@ func (r *KubeadmConfigReconciler) resolveSecretPasswordContent(ctx context.Conte
return data, nil
}

// skipTokenRefreshIfExpiringAfter returns a duration from "now". If the token's expiry timestamp is after
// skipTokenRefreshIfExpiringAfter returns a duration. If the token's expiry timestamp is after
// `now + skipTokenRefreshIfExpiringAfter()`, it does not yet need a refresh.
func (r *KubeadmConfigReconciler) skipTokenRefreshIfExpiringAfter() time.Duration {
// Choose according to how often reconciliation is "woken up" by `tokenCheckRefreshOrRotationInterval`.
Expand Down

0 comments on commit 6fa9f49

Please sign in to comment.