Browse Source

make reconciling stop if es is synced and immutable

Arthur 4 years ago
parent
commit
8417b34d26
1 changed files with 6 additions and 0 deletions
  1. 6 0
      pkg/controllers/externalsecret/externalsecret_controller.go

+ 6 - 0
pkg/controllers/externalsecret/externalsecret_controller.go

@@ -166,6 +166,12 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
 		log.V(1).Info("skipping refresh", "rv", getResourceVersion(externalSecret))
 		log.V(1).Info("skipping refresh", "rv", getResourceVersion(externalSecret))
 		return ctrl.Result{RequeueAfter: refreshInt}, nil
 		return ctrl.Result{RequeueAfter: refreshInt}, nil
 	}
 	}
+	if externalSecret.Status.SyncedResourceVersion != "" && externalSecret.Spec.Target.Immutable {
+		return ctrl.Result{
+			RequeueAfter: 0,
+			Requeue:      false,
+		}, nil
+	}
 
 
 	secret := &v1.Secret{
 	secret := &v1.Secret{
 		ObjectMeta: metav1.ObjectMeta{
 		ObjectMeta: metav1.ObjectMeta{