Merge pull request #2042 from Infisical/daniel/fix-k8-managed-secret-crash

fix(k8-operator): crash on predefined managed secret
This commit is contained in:
Maidul Islam
2024-06-28 17:01:37 -04:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@@ -13,9 +13,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: v0.6.1
version: v0.6.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v0.6.1"
appVersion: "v0.6.2"

View File

@@ -32,7 +32,7 @@ controllerManager:
- ALL
image:
repository: infisical/kubernetes-operator
tag: v0.6.1
tag: v0.6.2
resources:
limits:
cpu: 500m

View File

@@ -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