Fix integration test
This commit is contained in:
parent
5d2d2829d0
commit
d923d5ef02
|
|
@ -1,4 +1,4 @@
|
|||
FROM scratch AS first
|
||||
FROM gcr.io/distroless/base@sha256:628939ac8bf3f49571d05c6c76b8688cb4a851af6c7088e599388259875bde20 AS first
|
||||
CMD ["mycmd"]
|
||||
|
||||
FROM first
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ func reviewConfig(stage config.KanikoStage, config *v1.Config) error {
|
|||
}
|
||||
}
|
||||
if entrypoint && !cmd {
|
||||
config.Cmd = []string{}
|
||||
config.Cmd = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue