Skip to content

Commit

Permalink
add more unit test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Le <yangle@redhat.com>
  • Loading branch information
elgnay committed Sep 22, 2022
1 parent 0c4c772 commit 59db706
Show file tree
Hide file tree
Showing 8 changed files with 900 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ func main() {
}

if features.FeatureGates.Enabled(features.EphemeralIdentity) {
if err := (&manager.EphemeralIdentityReconciler{
Cache: mgr.GetCache(),
HubClient: mgr.GetClient(),
}).SetupWithManager(mgr); err != nil {
if err := (manager.NewEphemeralIdentityReconciler(
mgr.GetCache(),
mgr.GetClient(),
)).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to register EphemeralIdentityReconciler")
os.Exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/addon/agent/controller/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (r *TokenReconciler) isSoonExpiring(managed *authv1alpha1.ManagedServiceAcc

// check if the token should be refreshed
now := metav1.Now()
refreshThreshold := managed.Spec.Rotation.Validity.Duration / 5 * 4
refreshThreshold := managed.Spec.Rotation.Validity.Duration / 5 * 1
lifetime := managed.Status.ExpirationTimestamp.Sub(now.Time)
if lifetime < refreshThreshold {
return true, nil
Expand Down
Loading

0 comments on commit 59db706

Please sign in to comment.