mirror of
https://github.com/external-secrets/external-secrets.git
synced 2024-12-15 17:51:01 +00:00
update
This commit is contained in:
parent
629d2f391c
commit
e31a408e1d
3 changed files with 13 additions and 28 deletions
|
@ -69,9 +69,6 @@ spec:
|
|||
{{- if .Values.concurrent }}
|
||||
- --concurrent={{ .Values.concurrent }}
|
||||
{{- end }}
|
||||
{{- if .Values.enableAWSSession }}
|
||||
- --experimental-enable-aws-session-cache={{ .Values.enableAWSSession }}
|
||||
{{- end }}
|
||||
{{- range $key, $value := .Values.extraArgs }}
|
||||
{{- if $value }}
|
||||
- --{{ $key }}={{ $value }}
|
||||
|
|
|
@ -48,9 +48,6 @@ createOperator: true
|
|||
# a time.
|
||||
concurrent: 1
|
||||
|
||||
# -- If set External secret will reuse the AWS session without creating a new one on each request.
|
||||
enableAWSSession: false
|
||||
|
||||
serviceAccount:
|
||||
# -- Specifies whether a service account should be created.
|
||||
create: true
|
||||
|
|
|
@ -243,34 +243,21 @@ func DefaultSTSProvider(sess *session.Session) stsiface.STSAPI {
|
|||
// getAWSSession check if an AWS session should be reused
|
||||
// it returns the aws session or an error.
|
||||
func getAWSSession(config *aws.Config, store esv1beta1.GenericStore, namespace string) (*session.Session, error) {
|
||||
tmpSession := SessionCache{
|
||||
Name: store.GetObjectMeta().Name,
|
||||
Namespace: namespace,
|
||||
Kind: store.GetTypeMeta().Kind,
|
||||
ResourceVersion: store.GetObjectMeta().ResourceVersion,
|
||||
}
|
||||
|
||||
if EnableCache {
|
||||
tmpSession := SessionCache{
|
||||
Name: store.GetObjectMeta().Name,
|
||||
Namespace: namespace,
|
||||
Kind: store.GetTypeMeta().Kind,
|
||||
ResourceVersion: store.GetObjectMeta().ResourceVersion,
|
||||
}
|
||||
|
||||
_, ok := sessions[tmpSession]
|
||||
|
||||
sess, ok := sessions[tmpSession]
|
||||
if ok {
|
||||
log.Info("reusing aws session", "SecretStore", tmpSession.Name, "namespace", tmpSession.Namespace, "kind", tmpSession.Kind, "resourceversion", tmpSession.ResourceVersion)
|
||||
sess := sessions[tmpSession]
|
||||
return sess, nil
|
||||
}
|
||||
handlers := defaults.Handlers()
|
||||
handlers.Build.PushBack(request.WithAppendUserAgent("external-secrets"))
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
Config: *config,
|
||||
Handlers: handlers,
|
||||
SharedConfigState: session.SharedConfigDisable,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sessions[tmpSession] = sess
|
||||
return sess, nil
|
||||
}
|
||||
|
||||
handlers := defaults.Handlers()
|
||||
handlers.Build.PushBack(request.WithAppendUserAgent("external-secrets"))
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
|
@ -281,5 +268,9 @@ func getAWSSession(config *aws.Config, store esv1beta1.GenericStore, namespace s
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if EnableCache {
|
||||
sessions[tmpSession] = sess
|
||||
}
|
||||
return sess, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue