diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-23 11:04:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-23 11:04:48 +0200 |
commit | dade9159e7a0f848e101221274faa3f4f03cf132 (patch) | |
tree | 4fc8aa7a9379260c103d86c37cfc0a2ad511a9e9 /pkg/domain/infra/abi/play.go | |
parent | 2d24487ba244e5cd900f6aecc5d8896e1354d1ee (diff) | |
parent | 2faeb2189f81b6925d80aa8031cb5b19aa8618cb (diff) | |
download | podman-dade9159e7a0f848e101221274faa3f4f03cf132.tar.gz podman-dade9159e7a0f848e101221274faa3f4f03cf132.tar.bz2 podman-dade9159e7a0f848e101221274faa3f4f03cf132.zip |
Merge pull request #7054 from mheon/backports_203
Backports and Release Notes for v2.0.3
Diffstat (limited to 'pkg/domain/infra/abi/play.go')
-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 { |