From d4fb569c1281316fdaf2029eac260b3f5a8c6783 Mon Sep 17 00:00:00 2001 From: Kyle Penfound Date: Wed, 6 Mar 2024 14:38:23 -0500 Subject: [PATCH] fix file and cmd secret source inputs Signed-off-by: Kyle Penfound --- cmd/dagger/flags.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/dagger/flags.go b/cmd/dagger/flags.go index 718e9763fa2..658180363fe 100644 --- a/cmd/dagger/flags.go +++ b/cmd/dagger/flags.go @@ -357,7 +357,7 @@ func (v *secretValue) Get(ctx context.Context, c *dagger.Client) (any, error) { if err != nil { return nil, fmt.Errorf("failed to read secret file %q: %w", v.sourceVal, err) } - plaintext = string(filePlaintext) + plaintext = strings.TrimSpace(string(filePlaintext)) case commandSecretSource: // #nosec G204 @@ -365,7 +365,7 @@ func (v *secretValue) Get(ctx context.Context, c *dagger.Client) (any, error) { if err != nil { return nil, fmt.Errorf("failed to run secret command %q: %w", v.sourceVal, err) } - plaintext = string(stdoutBytes) + plaintext = strings.TrimSpace(string(stdoutBytes)) default: return nil, fmt.Errorf("unsupported secret arg source: %q", v.secretSource)