Browse Source

fix: do not return pointer to session from cache (#4478)

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
Moritz Johner 1 year ago
parent
commit
3692884086
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pkg/provider/aws/auth/auth.go

+ 1 - 1
pkg/provider/aws/auth/auth.go

@@ -330,7 +330,7 @@ func getAWSSession(config *aws.Config, enableCache bool, name, kind, namespace,
 		sess, ok := sessionCache.Get(resourceVersion, key)
 		sess, ok := sessionCache.Get(resourceVersion, key)
 		if ok {
 		if ok {
 			log.Info("reusing aws session", "SecretStore", key.Name, "namespace", key.Namespace, "kind", key.Kind, "resourceversion", resourceVersion)
 			log.Info("reusing aws session", "SecretStore", key.Name, "namespace", key.Namespace, "kind", key.Kind, "resourceversion", resourceVersion)
-			return sess, nil
+			return sess.Copy(), nil
 		}
 		}
 	}
 	}