Improve SecretStore integration with new method

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-09-01 21:46:56 +02:00
parent eabf1b52e5
commit cf13257b10
No known key found for this signature in database
GPG Key ID: 3C9847D981AAC1BF
2 changed files with 7 additions and 3 deletions

View File

@ -664,7 +664,7 @@ func (p *Pipeline) DockerLogin(ctx context.Context, op *compiler.Value, st llb.S
if err != nil { if err != nil {
return st, err 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 { if err != nil {
return st, err return st, err
} }

View File

@ -13,7 +13,11 @@ import (
type SecretsStore struct { type SecretsStore struct {
Secrets session.Attachable 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 { func NewSecretsStoreProvider(st *state.State) SecretsStore {
@ -21,7 +25,7 @@ func NewSecretsStoreProvider(st *state.State) SecretsStore {
return SecretsStore{ return SecretsStore{
Secrets: secretsprovider.NewSecretProvider(store), Secrets: secretsprovider.NewSecretProvider(store),
Store: store, store: store,
} }
} }