Skip to content

Commit 86db5a5

Browse files
committed
add a bit of extra validation
1 parent d463de4 commit 86db5a5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

integration/integration_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ func TestBuildFromDockerfileAndConfig(t *testing.T) {
562562

563563
validateDockerConfig := func(t *testing.T, tc testCase, ctrID, logs string) {
564564
t.Helper()
565+
566+
// Ensure that the config matches the expected value, base64 is
567+
// always prioritized over a file.
565568
got := execContainer(t, ctrID, "cat /docker_config_json")
566569
got = strings.TrimSpace(got)
567570
want := tc.configBase64
@@ -572,6 +575,15 @@ func TestBuildFromDockerfileAndConfig(t *testing.T) {
572575
require.Contains(t, logs, "Set DOCKER_CONFIG to /.envbuilder/.docker")
573576
require.Equal(t, want, got)
574577
}
578+
579+
// Ensure that a warning message is printed if config secrets
580+
// will remain in the container after build.
581+
warningMessage := "this file will remain after the build"
582+
if tc.configFile.name != "" {
583+
require.Contains(t, logs, warningMessage)
584+
} else {
585+
require.NotContains(t, logs, warningMessage)
586+
}
575587
}
576588

577589
configJSONContainerPath := workingdir.Default.Join(".docker", "config.json")

0 commit comments

Comments
 (0)