summaryrefslogtreecommitdiff
path: root/libpod/kube.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-04 13:12:42 -0500
committerGitHub <noreply@github.com>2021-02-04 13:12:42 -0500
commitaaa86c68c045519085fe7b174b6adce5f8373ad6 (patch)
tree17741e9494953292e2377773dbaff3845f42583a /libpod/kube.go
parentd178ba1e860b50c5ec5f6dcf5d06d483ecf6c348 (diff)
parentc995b54607a53d692ea2491771233895ff2c75a7 (diff)
downloadpodman-aaa86c68c045519085fe7b174b6adce5f8373ad6.tar.gz
podman-aaa86c68c045519085fe7b174b6adce5f8373ad6.tar.bz2
podman-aaa86c68c045519085fe7b174b6adce5f8373ad6.zip
Merge pull request #9220 from vrothberg/fix-9211
generate kube: handle entrypoint
Diffstat (limited to 'libpod/kube.go')
-rw-r--r--libpod/kube.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/libpod/kube.go b/libpod/kube.go
index bf314b9a3..f9ead027d 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -353,22 +353,21 @@ func containerToV1Container(c *Container) (v1.Container, []v1.Volume, *v1.PodDNS
return kubeContainer, kubeVolumes, nil, err
}
- containerCommands := c.Command()
- kubeContainer.Name = removeUnderscores(c.Name())
+ // Handle command and arguments.
+ if ep := c.Entrypoint(); len(ep) > 0 {
+ // If we have an entrypoint, set the container's command as
+ // arguments.
+ kubeContainer.Command = ep
+ kubeContainer.Args = c.Command()
+ } else {
+ kubeContainer.Command = c.Command()
+ }
+ kubeContainer.Name = removeUnderscores(c.Name())
_, image := c.Image()
kubeContainer.Image = image
kubeContainer.Stdin = c.Stdin()
- // prepend the entrypoint of the container to command
- if ep := c.Entrypoint(); len(c.Entrypoint()) > 0 {
- ep = append(ep, containerCommands...)
- containerCommands = ep
- }
- kubeContainer.Command = containerCommands
- // TODO need to figure out how we handle command vs entry point. Kube appears to prefer entrypoint.
- // right now we just take the container's command
- //container.Args = args
kubeContainer.WorkingDir = c.WorkingDir()
kubeContainer.Ports = ports
// This should not be applicable