Integration tests for entrypoint
This commit is contained in:
parent
d49c7c5ed1
commit
bf47ea928b
|
|
@ -2,3 +2,6 @@ FROM gcr.io/distroless/base:latest
|
||||||
CMD ["command", "one"]
|
CMD ["command", "one"]
|
||||||
CMD ["command", "two"]
|
CMD ["command", "two"]
|
||||||
CMD echo "hello"
|
CMD echo "hello"
|
||||||
|
|
||||||
|
ENTRYPOINT ["execute", "something"]
|
||||||
|
ENTRYPOINT ["execute", "entrypoint"]
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
schemaVersion: '2.0.0'
|
schemaVersion: '2.0.0'
|
||||||
metadataTest:
|
metadataTest:
|
||||||
cmd: ["/bin/sh", "-c", "echo \"hello\""]
|
cmd: ["/bin/sh", "-c", "echo \"hello\""]
|
||||||
|
entrypoint: ["execute", "entrypoint"]
|
||||||
|
|
@ -66,11 +66,11 @@ var structureTests = []struct {
|
||||||
structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_env.yaml",
|
structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_env.yaml",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test cmd",
|
description: "test metadata",
|
||||||
dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_cmd",
|
dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_metadata",
|
||||||
repo: "test-cmd",
|
repo: "test-metadata",
|
||||||
dockerBuildContext: "/workspace/integration_tests/dockerfiles/",
|
dockerBuildContext: "/workspace/integration_tests/dockerfiles/",
|
||||||
structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_cmd.yaml",
|
structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_metadata.yaml",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,13 @@ func (c *CmdCommand) FilesToSnapshot() []string {
|
||||||
|
|
||||||
// CreatedBy returns some information about the command for the image config history
|
// CreatedBy returns some information about the command for the image config history
|
||||||
func (c *CmdCommand) CreatedBy() string {
|
func (c *CmdCommand) CreatedBy() string {
|
||||||
|
cmd := []string{"CMD"}
|
||||||
cmdLine := strings.Join(c.cmd.CmdLine, " ")
|
cmdLine := strings.Join(c.cmd.CmdLine, " ")
|
||||||
if c.cmd.PrependShell {
|
if c.cmd.PrependShell {
|
||||||
// TODO: Support shell command here
|
// TODO: Support shell command here
|
||||||
shell := []string{"/bin/sh", "-c"}
|
shell := []string{"/bin/sh", "-c"}
|
||||||
return strings.Join(append(shell, cmdLine), " ")
|
appendedShell := append(cmd, shell...)
|
||||||
|
return strings.Join(append(appendedShell, cmdLine), " ")
|
||||||
}
|
}
|
||||||
return cmdLine
|
return strings.Join(append(cmd, cmdLine), " ")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue