Skip to content

Commit

Permalink
Fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Sep 11, 2018
1 parent 5d2d282 commit d923d5e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integration/dockerfiles/Dockerfile_test_cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM scratch AS first
FROM gcr.io/distroless/base@sha256:628939ac8bf3f49571d05c6c76b8688cb4a851af6c7088e599388259875bde20 AS first
CMD ["mycmd"]

FROM first
Expand Down
2 changes: 0 additions & 2 deletions pkg/commands/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/google/go-containerregistry/pkg/v1"
"github.com/moby/buildkit/frontend/dockerfile/instructions"
"github.com/sirupsen/logrus"
)

type CmdCommand struct {
Expand All @@ -48,7 +47,6 @@ func (c *CmdCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.Bui
newCommand = c.cmd.CmdLine
}

logrus.Infof("Replacing CMD in config with %v", newCommand)
config.Cmd = newCommand
config.ArgsEscaped = true
return nil
Expand Down
2 changes: 0 additions & 2 deletions pkg/commands/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/google/go-containerregistry/pkg/v1"
"github.com/moby/buildkit/frontend/dockerfile/instructions"
"github.com/sirupsen/logrus"
)

type EntrypointCommand struct {
Expand All @@ -47,7 +46,6 @@ func (e *EntrypointCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerf
newCommand = e.cmd.CmdLine
}

logrus.Infof("Replacing Entrypoint in config with %v", newCommand)
config.Entrypoint = newCommand
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/executor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func reviewConfig(stage config.KanikoStage, config *v1.Config) error {
}
}
if entrypoint && !cmd {
config.Cmd = []string{}
config.Cmd = nil
}
return nil
}
2 changes: 1 addition & 1 deletion pkg/executor/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Test_reviewConfig(t *testing.T) {
ENTRYPOINT ["myentrypoint"]`,
originalEntrypoint: []string{"myentrypoint"},
originalCmd: []string{"mycmd"},
expectedCmd: []string{},
expectedCmd: nil,
},
}
for _, test := range tests {
Expand Down

0 comments on commit d923d5e

Please sign in to comment.