summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-05 05:56:29 -0700
committerGitHub <noreply@github.com>2019-04-05 05:56:29 -0700
commited8bd80d3f09fb5c82c53bde8d6779db2613f158 (patch)
tree1713423430d08170701074cfe72c36cbbda8da1e /cmd
parentb446378f7a76ef03ff0760c81dfa53c0384ef6fa (diff)
parent65372ee3aba0f68a064f2e6269c271ff78f63ff0 (diff)
downloadpodman-ed8bd80d3f09fb5c82c53bde8d6779db2613f158.tar.gz
podman-ed8bd80d3f09fb5c82c53bde8d6779db2613f158.tar.bz2
podman-ed8bd80d3f09fb5c82c53bde8d6779db2613f158.zip
Merge pull request #2856 from haircommander/kube-entrypoint
Respect image entrypoint in play kube
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/play_kube.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd/podman/play_kube.go b/cmd/podman/play_kube.go
index 56d80070c..cbe961279 100644
--- a/cmd/podman/play_kube.go
+++ b/cmd/podman/play_kube.go
@@ -269,7 +269,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