diff --git a/k8-operator/controllers/infisicalsecret_helper.go b/k8-operator/controllers/infisicalsecret_helper.go index 9ae6ad69a..f92275af4 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