summaryrefslogtreecommitdiff
path: root/cmd/podman/pods/create.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-01-09 10:28:21 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-01-10 16:13:33 -0500
commit19a475906612b603b11fbbf6ee6a6978a4bd9586 (patch)
tree6ae0507c33be21bcc265a547322f94fc4a00db7f /cmd/podman/pods/create.go
parent87cd4b698cea28ef99b3b3326309b068b9aa7f04 (diff)
downloadpodman-19a475906612b603b11fbbf6ee6a6978a4bd9586.tar.gz
podman-19a475906612b603b11fbbf6ee6a6978a4bd9586.tar.bz2
podman-19a475906612b603b11fbbf6ee6a6978a4bd9586.zip
Use the InfraImage defined in containers.conf
Remove hard code use of the DefaultInfraImage and rely on getting this from containers.conf. Fixes: https://github.com/containers/podman/issues/12771 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/pods/create.go')
-rw-r--r--cmd/podman/pods/create.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index f844812c2..6a28f7a79 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -71,7 +71,11 @@ func init() {
_ = createCommand.RegisterFlagCompletionFunc(nameFlagName, completion.AutocompleteNone)
infraImageFlagName := "infra-image"
- flags.StringVar(&infraImage, infraImageFlagName, containerConfig.Engine.InfraImage, "The image of the infra container to associate with the pod")
+ var defInfraImage string
+ if !registry.IsRemote() {
+ defInfraImage = containerConfig.Engine.InfraImage
+ }
+ flags.StringVar(&infraImage, infraImageFlagName, defInfraImage, "The image of the infra container to associate with the pod")
_ = createCommand.RegisterFlagCompletionFunc(infraImageFlagName, common.AutocompleteImages)
podIDFileFlagName := "pod-id-file"
@@ -109,7 +113,9 @@ func create(cmd *cobra.Command, args []string) error {
return errors.Wrapf(err, "unable to process labels")
}
- imageName = infraImage
+ if cmd.Flag("infra-image").Changed {
+ imageName = infraImage
+ }
img := imageName
if !createOptions.Infra {
if cmd.Flag("no-hosts").Changed {