diff --git a/internal/commands/build.go b/internal/commands/build.go index d2a516b38e..4567f30b27 100644 --- a/internal/commands/build.go +++ b/internal/commands/build.go @@ -174,16 +174,6 @@ func validateBuildFlags(flags *BuildFlags, cfg config.Config, packClient PackCli return errors.New("cache-image flag requires the publish flag") } - dockerHostValid := strings.HasPrefix(flags.DockerHost, `tcp://`) || - strings.HasPrefix(flags.DockerHost, `unix://`) || - strings.HasPrefix(flags.DockerHost, `npipe://`) || - strings.HasPrefix(flags.DockerHost, `npipe:\\`) || - flags.DockerHost == "inherit" || - flags.DockerHost == "" - if !dockerHostValid { - return errors.New("value of docker-host flag is not valid") - } - return nil } diff --git a/internal/commands/build_test.go b/internal/commands/build_test.go index 089f091ad0..904685731a 100644 --- a/internal/commands/build_test.go +++ b/internal/commands/build_test.go @@ -75,17 +75,7 @@ func testBuildCommand(t *testing.T, when spec.G, it spec.S) { command.SetArgs([]string{"--builder", "my-builder", "image"}) h.AssertNil(t, command.Execute()) }) - - it("docker-host value is invalid", func() { - mockClient.EXPECT(). - Build(gomock.Any(), EqBuildOptionsWithImage("my-builder", "image")). - Return(nil) - - command.SetArgs([]string{"--builder", "my-builder", "image", "--docker-host", "@bad_val"}) - err := command.Execute() - h.AssertError(t, err, "value of docker-host flag is not valid") - }) - + it("builds an image with a builder short command arg", func() { mockClient.EXPECT(). Build(gomock.Any(), EqBuildOptionsWithImage("my-builder", "image")).