diff options
author | Peter Hunt <pehunt@redhat.com> | 2019-04-04 22:04:57 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2019-04-04 22:31:36 -0400 |
commit | 65372ee3aba0f68a064f2e6269c271ff78f63ff0 (patch) | |
tree | abed5017e0f8ae82567db18f9d18637624bd4f09 /cmd/podman | |
parent | bda28c61dbab1796035d79aad91a0c52458b3dd8 (diff) | |
download | podman-65372ee3aba0f68a064f2e6269c271ff78f63ff0.tar.gz podman-65372ee3aba0f68a064f2e6269c271ff78f63ff0.tar.bz2 podman-65372ee3aba0f68a064f2e6269c271ff78f63ff0.zip |
Respect image entrypoint in play kube
Before we ignored an entrypoint specified in an image, which lead to crashes when a user assumed the entrypoint would be used
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/play_kube.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd/podman/play_kube.go b/cmd/podman/play_kube.go index b468a7a89..7c5986abe 100644 --- a/cmd/podman/play_kube.go +++ b/cmd/podman/play_kube.go @@ -270,7 +270,19 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container } } - containerConfig.Command = containerYAML.Command + containerConfig.Command = []string{} + if imageData != nil && imageData.Config != nil { + containerConfig.Command = append(containerConfig.Command, imageData.Config.Entrypoint...) + } + if len(containerConfig.Command) != 0 { + containerConfig.Command = append(containerConfig.Command, containerYAML.Command...) + } else if imageData != nil && imageData.Config != nil { + containerConfig.Command = append(containerConfig.Command, imageData.Config.Cmd...) + } + if imageData != nil && len(containerConfig.Command) == 0 { + return nil, errors.Errorf("No command specified in container YAML or as CMD or ENTRYPOINT in this image for %s", containerConfig.Name) + } + containerConfig.StopSignal = 15 // If the user does not pass in ID mappings, just set to basics |