Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix: Annotations map nil sometimes nil when pre-created by the user

Daniel Hougaard1ddacfda6229
diff --git a/k8-operator/controllers/infisicalsecret_helper.go b/k8-operator/controllers/infisicalsecret_helper.go
index 9ae6ad69a4..f92275af48 100644
--- a/k8-operator/controllers/infisicalsecret_helper.go
+++ b/k8-operator/controllers/infisicalsecret_helper.go
@@ -267,6 +267,11 @@ func (r *InfisicalSecretReconciler) UpdateInfisicalManagedKubeSecret(ctx context
plainProcessedSecrets[secret.Key] = []byte(secret.Value)
}
+ // Initialize the Annotations map if it's nil
+ if managedKubeSecret.ObjectMeta.Annotations == nil {
+ managedKubeSecret.ObjectMeta.Annotations = make(map[string]string)
+ }
+
managedKubeSecret.Data = plainProcessedSecrets
managedKubeSecret.ObjectMeta.Annotations[SECRET_VERSION_ANNOTATION] = ETag