Skip to content

Commit a628d3d

Browse files
committed
mz507: set BUILDX_NO_DEFAULT_ATTESTATIONS=1
1 parent 57c4ee3 commit a628d3d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

integration/images.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ func (d *DockerFileBuilder) BuildDockerImage(t *testing.T, imageRepo, dockerfile
387387
if env, ok := envsMap[dockerfile]; ok {
388388
dockerCmd.Env = append(dockerCmd.Env, env...)
389389
}
390+
dockerCmd.Env = append(dockerCmd.Env, "BUILDX_NO_DEFAULT_ATTESTATIONS=1")
390391

391392
out, err := RunCommandWithoutTest(dockerCmd)
392393
if err != nil {
@@ -620,6 +621,7 @@ func (d *DockerFileBuilder) buildRelativePathsImage(logf logger, imageRepo, dock
620621
"./context",
621622
}...,
622623
)
624+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
623625

624626
timer := timing.Start(dockerfile + "_docker")
625627
out, err := RunCommandWithoutTest(dockerCmd)

integration/integration_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ func testGitBuildcontextHelper(t *testing.T, url string, commit string, branch s
283283
"-f", dockerfile,
284284
DockerGitRepo(url, commit, branch),
285285
}...)
286+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
286287
out, err := RunCommandWithoutTest(dockerCmd)
287288
if err != nil {
288289
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
@@ -356,6 +357,7 @@ func TestGitBuildcontextSubPath(t *testing.T) {
356357
"-f", filepath.Join(integrationPath, dockerfilesPath, dockerfile),
357358
DockerGitRepo(url, "", branch),
358359
}...)
360+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
359361
out, err := RunCommandWithoutTest(dockerCmd)
360362
if err != nil {
361363
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
@@ -402,6 +404,7 @@ func TestBuildViaRegistryMirrors(t *testing.T) {
402404
"-f", dockerfile,
403405
DockerGitRepo(url, "", branch),
404406
}...)
407+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
405408
out, err := RunCommandWithoutTest(dockerCmd)
406409
if err != nil {
407410
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
@@ -446,6 +449,7 @@ func TestBuildViaRegistryMap(t *testing.T) {
446449
"-f", dockerfile,
447450
DockerGitRepo(url, "", branch),
448451
}...)
452+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
449453
out, err := RunCommandWithoutTest(dockerCmd)
450454
if err != nil {
451455
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
@@ -515,6 +519,7 @@ func TestKanikoDir(t *testing.T) {
515519
"-f", dockerfile,
516520
DockerGitRepo(url, "", branch),
517521
}...)
522+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
518523
out, err := RunCommandWithoutTest(dockerCmd)
519524
if err != nil {
520525
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
@@ -561,6 +566,7 @@ func TestBuildWithLabels(t *testing.T) {
561566
"--label", testLabel,
562567
DockerGitRepo(url, "", branch),
563568
}...)
569+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
564570
out, err := RunCommandWithoutTest(dockerCmd)
565571
if err != nil {
566572
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
@@ -605,6 +611,7 @@ func TestBuildWithHTTPError(t *testing.T) {
605611
"-f", dockerfile,
606612
DockerGitRepo(url, "", branch),
607613
}...)
614+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
608615
out, err := RunCommandWithoutTest(dockerCmd)
609616
if err == nil {
610617
t.Errorf("an error was expected, got %s", string(out))
@@ -963,6 +970,7 @@ func TestBuildWithAnnotations(t *testing.T) {
963970
"-f", dockerfile,
964971
DockerGitRepo(url, "", branch),
965972
)
973+
dockerCmd.Env = []string{"BUILDX_NO_DEFAULT_ATTESTATIONS=1"}
966974
out, err := RunCommandWithoutTest(dockerCmd)
967975
if err != nil {
968976
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))

0 commit comments

Comments
 (0)