Skip to content

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

patch: loop variable deployment captured by func literal

Maidul Islamff9418c0c776
diff --git a/k8-operator/controllers/auto_redeployment.go b/k8-operator/controllers/auto_redeployment.go
index e4fa6d00fe..cd5bf193b7 100644
--- a/k8-operator/controllers/auto_redeployment.go
+++ b/k8-operator/controllers/auto_redeployment.go
@@ -36,6 +36,7 @@ func (r *InfisicalSecretReconciler) ReconcileDeploymentsWithManagedSecrets(ctx c
var wg sync.WaitGroup
// Iterate over the deployments and check if they use the managed secret
for _, deployment := range listOfDeployments.Items {
+ deployment := deployment
if deployment.Annotations[AUTO_RELOAD_DEPLOYMENT_ANNOTATION] == "true" && r.IsDeploymentUsingManagedSecret(deployment, infisicalSecret) {
// Start a goroutine to reconcile the deployment
wg.Add(1)