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:
commit
0fb03e4650
1 changed files with 6 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue