Skip to content

Commit a8426ed

Browse files
committed
Return the /run/secrets as is
Trust the one that put the secret in there Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
1 parent 4b0bcef commit a8426ed

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

pkg/environment/secrets.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"log/slog"
66
"os"
7-
"strings"
87

98
"github.com/docker/cagent/pkg/path"
109
)
@@ -38,5 +37,5 @@ func (p *RunSecretsProvider) Get(_ context.Context, name string) string {
3837
return ""
3938
}
4039

41-
return strings.Split(string(buf), "\n")[0]
40+
return string(buf)
4241
}

pkg/environment/secrets_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ func TestRunSecretsProvider(t *testing.T) {
4646
writer: writeNothing(),
4747
expected: "",
4848
},
49-
{
50-
name: "ignore new lines",
51-
key: "KEY",
52-
writer: writeSecret("VALUE\n\n"),
53-
expected: "VALUE",
54-
},
5549
}
5650

5751
for _, test := range tests {

0 commit comments

Comments
 (0)