add secrets ready to sync condition

This commit is contained in:
Maidul Islam
2022-12-15 20:02:22 -05:00
parent 0ef9db99b4
commit 72bf160f2e
5 changed files with 56 additions and 18 deletions
@@ -54,6 +54,7 @@ func (r *InfisicalSecretReconciler) Reconcile(ctx context.Context, req ctrl.Requ
}
err = r.ReconcileInfisicalSecret(ctx, infisicalSecretCR)
r.SetReadyToSyncSecretsConditions(ctx, &infisicalSecretCR, err)
if err != nil {
log.Error(err, "Unable to reconcile Infisical Secret and will try again")
return ctrl.Result{
@@ -61,7 +62,10 @@ func (r *InfisicalSecretReconciler) Reconcile(ctx context.Context, req ctrl.Requ
}, nil
}
return ctrl.Result{}, nil
// Sync again after the specified time
return ctrl.Result{
RequeueAfter: time.Minute,
}, nil
}
// SetupWithManager sets up the controller with the Manager.