1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

Merge pull request #450 from external-secrets/feature/log-on-success

Added log for first secret reconciliation after errors
This commit is contained in:
paul-the-alien[bot] 2021-11-02 23:34:57 +00:00 committed by GitHub
commit 0fb03e4650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,11 +238,16 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
}
conditionSynced := NewExternalSecretCondition(esv1alpha1.ExternalSecretReady, v1.ConditionTrue, esv1alpha1.ConditionReasonSecretSynced, "Secret was synced")
currCond := GetExternalSecretCondition(externalSecret.Status, esv1alpha1.ExternalSecretReady)
SetExternalSecretCondition(&externalSecret, *conditionSynced)
externalSecret.Status.RefreshTime = metav1.NewTime(time.Now())
externalSecret.Status.SyncedResourceVersion = getResourceVersion(externalSecret)
syncCallsTotal.With(syncCallsMetricLabels).Inc()
log.V(1).Info("reconciled secret")
if currCond == nil || currCond.Status != conditionSynced.Status {
log.Info("reconciled secret") // Log once if on success in any verbosity
} else {
log.V(1).Info("reconciled secret") // Log all reconciliation cycles if higher verbosity applied
}
return ctrl.Result{
RequeueAfter: refreshInt,