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

skip processing cluster secret store

This commit is contained in:
Eric Chan 2022-03-11 08:58:49 +10:00
parent 553d99a456
commit da6e457b50
2 changed files with 17 additions and 10 deletions

View file

@ -130,11 +130,12 @@ var rootCmd = &cobra.Command{
}
}
if err = (&externalsecret.Reconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("ExternalSecret"),
Scheme: mgr.GetScheme(),
ControllerClass: controllerClass,
RequeueInterval: time.Hour,
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("ExternalSecret"),
Scheme: mgr.GetScheme(),
ControllerClass: controllerClass,
RequeueInterval: time.Hour,
ClusterSecretStoreEnabled: enableClusterStoreReconciler,
}).SetupWithManager(mgr, controller.Options{
MaxConcurrentReconciles: concurrent,
}); err != nil {

View file

@ -74,11 +74,12 @@ const (
// Reconciler reconciles a ExternalSecret object.
type Reconciler struct {
client.Client
Log logr.Logger
Scheme *runtime.Scheme
ControllerClass string
RequeueInterval time.Duration
recorder record.EventRecorder
Log logr.Logger
Scheme *runtime.Scheme
ControllerClass string
RequeueInterval time.Duration
ClusterSecretStoreEnabled bool
recorder record.EventRecorder
}
// Reconcile implements the main reconciliation loop
@ -108,6 +109,11 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, nil
}
if !r.ClusterSecretStoreEnabled && externalSecret.Spec.SecretStoreRef.Kind == esv1beta1.ClusterSecretStoreKind {
log.Info("skipping cluster secret store as it is disabled")
return ctrl.Result{}, nil
}
// patch status when done processing
p := client.MergeFrom(externalSecret.DeepCopy())
defer func() {