diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-22 05:37:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-22 05:37:35 -0400 |
commit | 2643967bc04ee3ab9f8c204bb5a4258588d03ad9 (patch) | |
tree | fb215e1d58b3cf74236d2b2e244bebb6a5f74787 /pkg | |
parent | c0998f728a9a6d9344bdacb4d4820ea36e132f44 (diff) | |
parent | a87579cedf2ab8658da3a13d5d610f5b1a80535f (diff) | |
download | podman-2643967bc04ee3ab9f8c204bb5a4258588d03ad9.tar.gz podman-2643967bc04ee3ab9f8c204bb5a4258588d03ad9.tar.bz2 podman-2643967bc04ee3ab9f8c204bb5a4258588d03ad9.zip |
Merge pull request #7002 from zhangguanzhang/master
fix podman play kube doesn't override dockerfile ENTRYPOINT
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index f82da2c95..888811958 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -453,11 +453,16 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container containerConfig.Command = []string{} if imageData != nil && imageData.Config != nil { - containerConfig.Command = append(containerConfig.Command, imageData.Config.Entrypoint...) + containerConfig.Command = imageData.Config.Entrypoint } if len(containerYAML.Command) != 0 { - containerConfig.Command = append(containerConfig.Command, containerYAML.Command...) - } else if imageData != nil && imageData.Config != nil { + containerConfig.Command = containerYAML.Command + } + // doc https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes + if len(containerYAML.Args) != 0 { + containerConfig.Command = append(containerConfig.Command, containerYAML.Args...) + } else if len(containerYAML.Command) == 0 { + // Add the Cmd from the image config only if containerYAML.Command and containerYAML.Args are empty containerConfig.Command = append(containerConfig.Command, imageData.Config.Cmd...) } if imageData != nil && len(containerConfig.Command) == 0 { |