summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-14 01:51:24 +0200
committerGitHub <noreply@github.com>2021-10-14 01:51:24 +0200
commita76c7555e7c9b7e5c81526123e36f80ce2da1ded (patch)
tree7dd5b94ee86aaa1119780e790e9c309174b5966c /libpod
parent9f1452cbb51bbca221c307e6da60af51a65489cd (diff)
parent5d18fb92397720eb416f760a55fe37ad2d5ae63a (diff)
downloadpodman-a76c7555e7c9b7e5c81526123e36f80ce2da1ded.tar.gz
podman-a76c7555e7c9b7e5c81526123e36f80ce2da1ded.tar.bz2
podman-a76c7555e7c9b7e5c81526123e36f80ce2da1ded.zip
Merge pull request #11947 from umohnani8/kube
Don't add image entrypoint to the generate kube yaml
Diffstat (limited to 'libpod')
-rw-r--r--libpod/kube.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/kube.go b/libpod/kube.go
index 43acd856d..d68140d5e 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -481,7 +481,9 @@ func containerToV1Container(ctx context.Context, c *Container) (v1.Container, []
if err != nil {
return kubeContainer, kubeVolumes, nil, annotations, err
}
- if reflect.DeepEqual(imgData.Config.Cmd, kubeContainer.Command) {
+ // If the user doesn't set a command/entrypoint when creating the container with podman and
+ // is using the image command or entrypoint from the image, don't add it to the generated kube yaml
+ if reflect.DeepEqual(imgData.Config.Cmd, kubeContainer.Command) || reflect.DeepEqual(imgData.Config.Entrypoint, kubeContainer.Command) {
kubeContainer.Command = nil
}