Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fix(k8-operator): updating CRD does not reflect in operator
Daniel Hougaard80d450e98012
diff --git a/k8-operator/controllers/infisicalsecret_controller.go b/k8-operator/controllers/infisicalsecret_controller.goindex 2d7089d5dd..b40a9a2c8d 100644--- a/k8-operator/controllers/infisicalsecret_controller.go+++ b/k8-operator/controllers/infisicalsecret_controller.go@@ -187,12 +187,18 @@ func (r *InfisicalSecretReconciler) Reconcile(ctx context.Context, req ctrl.Requfunc (r *InfisicalSecretReconciler) SetupWithManager(mgr ctrl.Manager) error {return ctrl.NewControllerManagedBy(mgr).- For(&secretsv1alpha1.InfisicalSecret{}).+ // For the Infisical Secret CRD we specifically watch for the update event, because we need to delete the entry in the resourceVariablesMap, so it will refresh the variables used to fetch secrets.+ For(&secretsv1alpha1.InfisicalSecret{}, builder.WithPredicates(predicate.Funcs{+ UpdateFunc: func(e event.UpdateEvent) bool {+ delete(resourceVariablesMap, string(e.ObjectNew.GetUID()))+ return true+ },+ })).+ // We only monitor the delete events for the Secret resource, so we can handle them in a finalizer.Watches(&source.Kind{Type: &corev1.Secret{}},handler.EnqueueRequestsFromMapFunc(r.handleManagedSecretDeletion),builder.WithPredicates(predicate.Funcs{- // Always return true to ensure we process all delete eventsDeleteFunc: func(e event.DeleteEvent) bool {return true},