summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-11 00:25:09 +0100
committerGitHub <noreply@github.com>2022-01-11 00:25:09 +0100
commited9ef59e7ea439b670875863132b68fd094501c7 (patch)
tree02ef3d057b928b7903954a54dc7ba0f7ab466763 /cmd/podman
parent2790b5c69c729df7ba83b214800de387fd43c646 (diff)
parent19a475906612b603b11fbbf6ee6a6978a4bd9586 (diff)
downloadpodman-ed9ef59e7ea439b670875863132b68fd094501c7.tar.gz
podman-ed9ef59e7ea439b670875863132b68fd094501c7.tar.bz2
podman-ed9ef59e7ea439b670875863132b68fd094501c7.zip
Merge pull request #12780 from rhatdan/pod
Use the InfraImage defined in containers.conf
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/create.go5
-rw-r--r--cmd/podman/pods/create.go10
2 files changed, 9 insertions, 6 deletions
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index 9610c29dc..694b97fe5 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -388,10 +388,7 @@ func createPodIfNecessary(cmd *cobra.Command, s *specgen.SpecGenerator, netOpts
if err != nil {
return nil, err
}
- imageName := config.DefaultInfraImage
- podGen.InfraImage = imageName
- podGen.InfraContainerSpec = specgen.NewSpecGenerator(imageName, false)
- podGen.InfraContainerSpec.RawImageName = imageName
+ podGen.InfraContainerSpec = specgen.NewSpecGenerator("", false)
podGen.InfraContainerSpec.NetworkOptions = podGen.NetworkOptions
err = specgenutil.FillOutSpecGen(podGen.InfraContainerSpec, &infraOpts, []string{})
if err != nil {
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 {