summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/create.go5
-rw-r--r--cmd/podman/machine/list.go3
-rw-r--r--cmd/podman/machine/start.go2
-rw-r--r--cmd/podman/pods/create.go10
4 files changed, 12 insertions, 8 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/machine/list.go b/cmd/podman/machine/list.go
index 858d87401..ed43b42df 100644
--- a/cmd/podman/machine/list.go
+++ b/cmd/podman/machine/list.go
@@ -32,6 +32,7 @@ var (
Args: validate.NoArgs,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman machine list,
+ podman machine list --format json
podman machine ls`,
}
listFlag = listFlagType{}
@@ -96,7 +97,7 @@ func list(cmd *cobra.Command, args []string) error {
return err
}
- b, err := json.Marshal(machineReporter)
+ b, err := json.MarshalIndent(machineReporter, "", " ")
if err != nil {
return err
}
diff --git a/cmd/podman/machine/start.go b/cmd/podman/machine/start.go
index 9c9c24f64..a3770d61a 100644
--- a/cmd/podman/machine/start.go
+++ b/cmd/podman/machine/start.go
@@ -60,9 +60,9 @@ func start(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
+ fmt.Printf("Starting machine %q\n", vmName)
if err := vm.Start(vmName, machine.StartOptions{}); err != nil {
return err
}
- fmt.Printf("Machine %q started successfully\n", vmName)
return 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 {