Fix integration test

This commit is contained in:
Priya Wadhwa 2018-09-11 10:05:15 -07:00
parent 5d2d2829d0
commit d923d5ef02
5 changed files with 3 additions and 7 deletions

View File

@ -1,4 +1,4 @@
FROM scratch AS first FROM gcr.io/distroless/base@sha256:628939ac8bf3f49571d05c6c76b8688cb4a851af6c7088e599388259875bde20 AS first
CMD ["mycmd"] CMD ["mycmd"]
FROM first FROM first

View File

@ -23,7 +23,6 @@ import (
"github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1"
"github.com/moby/buildkit/frontend/dockerfile/instructions" "github.com/moby/buildkit/frontend/dockerfile/instructions"
"github.com/sirupsen/logrus"
) )
type CmdCommand struct { type CmdCommand struct {
@ -48,7 +47,6 @@ func (c *CmdCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.Bui
newCommand = c.cmd.CmdLine newCommand = c.cmd.CmdLine
} }
logrus.Infof("Replacing CMD in config with %v", newCommand)
config.Cmd = newCommand config.Cmd = newCommand
config.ArgsEscaped = true config.ArgsEscaped = true
return nil return nil

View File

@ -23,7 +23,6 @@ import (
"github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1"
"github.com/moby/buildkit/frontend/dockerfile/instructions" "github.com/moby/buildkit/frontend/dockerfile/instructions"
"github.com/sirupsen/logrus"
) )
type EntrypointCommand struct { type EntrypointCommand struct {
@ -47,7 +46,6 @@ func (e *EntrypointCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerf
newCommand = e.cmd.CmdLine newCommand = e.cmd.CmdLine
} }
logrus.Infof("Replacing Entrypoint in config with %v", newCommand)
config.Entrypoint = newCommand config.Entrypoint = newCommand
return nil return nil
} }

View File

@ -248,7 +248,7 @@ func reviewConfig(stage config.KanikoStage, config *v1.Config) error {
} }
} }
if entrypoint && !cmd { if entrypoint && !cmd {
config.Cmd = []string{} config.Cmd = nil
} }
return nil return nil
} }

View File

@ -50,7 +50,7 @@ func Test_reviewConfig(t *testing.T) {
ENTRYPOINT ["myentrypoint"]`, ENTRYPOINT ["myentrypoint"]`,
originalEntrypoint: []string{"myentrypoint"}, originalEntrypoint: []string{"myentrypoint"},
originalCmd: []string{"mycmd"}, originalCmd: []string{"mycmd"},
expectedCmd: []string{}, expectedCmd: nil,
}, },
} }
for _, test := range tests { for _, test := range tests {