From cf13257b103245dc2572f827aa13972dc2e71042 Mon Sep 17 00:00:00 2001 From: Tom Chauveau Date: Wed, 1 Sep 2021 21:46:56 +0200 Subject: [PATCH] Improve SecretStore integration with new method Signed-off-by: Tom Chauveau --- environment/pipeline.go | 2 +- solver/secretsprovider.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/environment/pipeline.go b/environment/pipeline.go index 8b912ddd..e515e040 100644 --- a/environment/pipeline.go +++ b/environment/pipeline.go @@ -664,7 +664,7 @@ func (p *Pipeline) DockerLogin(ctx context.Context, op *compiler.Value, st llb.S if err != nil { return st, err } - secretBytes, err := p.s.GetOptions().SecretsStore.Store.GetSecret(ctx, id) + secretBytes, err := p.s.GetOptions().SecretsStore.GetSecret(ctx, id) if err != nil { return st, err } diff --git a/solver/secretsprovider.go b/solver/secretsprovider.go index a5199815..3e255bcb 100644 --- a/solver/secretsprovider.go +++ b/solver/secretsprovider.go @@ -13,7 +13,11 @@ import ( type SecretsStore struct { Secrets session.Attachable - Store *inputStore + store *inputStore +} + +func (s SecretsStore) GetSecret(ctx context.Context, id string) ([]byte, error) { + return s.store.GetSecret(ctx, id) } func NewSecretsStoreProvider(st *state.State) SecretsStore { @@ -21,7 +25,7 @@ func NewSecretsStoreProvider(st *state.State) SecretsStore { return SecretsStore{ Secrets: secretsprovider.NewSecretProvider(store), - Store: store, + store: store, } }