Browse Source

Fix quiet option when using COMPOSE_BAKE=1

Signed-off-by: Anvar Umuraliev <[email protected]>
Anvar Umuraliev 6 months ago
parent
commit
23fc76a540
2 changed files with 8 additions and 0 deletions
  1. 3 0
      pkg/compose/build_bake.go
  2. 5 0
      pkg/e2e/build_test.go

+ 3 - 0
pkg/compose/build_bake.go

@@ -261,6 +261,9 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
 	if options.Builder != "" {
 		args = append(args, "--builder", options.Builder)
 	}
+	if options.Quiet {
+		args = append(args, "--progress=quiet")
+	}
 
 	logrus.Debugf("Executing bake with args: %v", args)
 

+ 5 - 0
pkg/e2e/build_test.go

@@ -128,6 +128,11 @@ func TestLocalComposeBuild(t *testing.T) {
 			assert.Assert(t, !strings.Contains(res.Stdout(), "failed to push"), res.Stdout())
 		})
 
+		t.Run(env+" build --quiet", func(t *testing.T) {
+			res := c.RunDockerComposeCmd(t, "--project-directory", "fixtures/build-test", "build", "--quiet")
+			res.Assert(t, icmd.Expected{Out: ""})
+		})
+
 		t.Run(env+" cleanup build project", func(t *testing.T) {
 			c.RunDockerComposeCmd(t, "--project-directory", "fixtures/build-test", "down")
 			c.RunDockerOrExitError(t, "rmi", "-f", "build-test-nginx")