diff --git a/deploy/helm/credstash-operator/templates/deployment.yaml b/deploy/helm/credstash-operator/templates/deployment.yaml index aeffef5..9e1a399 100644 --- a/deploy/helm/credstash-operator/templates/deployment.yaml +++ b/deploy/helm/credstash-operator/templates/deployment.yaml @@ -26,6 +26,9 @@ spec: args: {{- if .Values.operatorInstance }} - --selector-label={{ .Values.operatorInstance }} +{{- end }} +{{- if .Values.verboseLogging }} + - --zap-level 1 {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: diff --git a/deploy/helm/credstash-operator/values.yaml b/deploy/helm/credstash-operator/values.yaml index 5f5a2dc..996ef62 100644 --- a/deploy/helm/credstash-operator/values.yaml +++ b/deploy/helm/credstash-operator/values.yaml @@ -16,7 +16,10 @@ fullnameOverride: "" namespaceToWatch: # Specifies which operatorInstance to filter the CRDs - defaults to all CRDs. # Use this if you wish to deploy multiple controllers, each using a different AWS config for example -operatorInstance: +operatorInstance: + +# Specifies whether to turn on verbose logs +verboseLogging: false awsCredentials: create: false diff --git a/pkg/controller/credstashsecret/credstashsecret_controller.go b/pkg/controller/credstashsecret/credstashsecret_controller.go index da0ed14..4fbad91 100644 --- a/pkg/controller/credstashsecret/credstashsecret_controller.go +++ b/pkg/controller/credstashsecret/credstashsecret_controller.go @@ -93,7 +93,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { err = c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{ IsController: true, OwnerType: &credstashv1alpha1.CredstashSecret{}, - }) + }, pred) if err != nil { return err } @@ -197,7 +197,7 @@ func (r *ReconcileCredstashSecret) Reconcile(request reconcile.Request) (reconci } // Secret is out of date with credstash data - if !reflect.DeepEqual(secret.Data, found.Data) { + if !reflect.DeepEqual(secret, found) { reqLogger.Info( "Updating Secret because contents have changed", "Secret.Namespace", @@ -239,6 +239,7 @@ func (r *ReconcileCredstashSecret) secretForCR(cr *credstashv1alpha1.CredstashSe ObjectMeta: metav1.ObjectMeta{ Name: secretName, Namespace: cr.Namespace, + Labels: cr.GetLabels(), }, Data: credstashSecretsValueMap, }