Skip to content

Commit

Permalink
Revert "fix file and cmd secret source inputs (dagger#6845)" (dagger#…
Browse files Browse the repository at this point in the history
…7271)

This reverts commit 5fbe1b2.
  • Loading branch information
marcosnils authored and vikram-dagger committed May 8, 2024
1 parent 69766ac commit 0780ca2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Breaking-20240507-134020.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Breaking
body: Remove space stripping from secret arguments
time: 2024-05-07T13:40:20.158396621-03:00
custom:
Author: marcosnils
PR: "7271"
4 changes: 2 additions & 2 deletions cmd/dagger/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ func (v *secretValue) Get(ctx context.Context, c *dagger.Client, _ *dagger.Modul
if err != nil {
return nil, fmt.Errorf("failed to read secret file %q: %w", v.sourceVal, err)
}
plaintext = strings.TrimSpace(string(filePlaintext))
plaintext = string(filePlaintext)

case commandSecretSource:
// #nosec G204
stdoutBytes, err := exec.CommandContext(ctx, "sh", "-c", v.sourceVal).Output()
if err != nil {
return nil, fmt.Errorf("failed to run secret command %q: %w", v.sourceVal, err)
}
plaintext = strings.TrimSpace(string(stdoutBytes))
plaintext = string(stdoutBytes)

default:
return nil, fmt.Errorf("unsupported secret arg source: %q", v.secretSource)
Expand Down

0 comments on commit 0780ca2

Please sign in to comment.