summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorCharlie Doern <cdoern@redhat.com>2022-07-25 10:21:14 -0400
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 14:46:12 -0400
commitc85722eb9f552f2456d33589a1417264369a6366 (patch)
tree2e055a356eadd8c992766cdd4168ebb0293c9719 /cmd/podman
parentc3e0f8ebef13e107b179fb6cf867ca8902f3761a (diff)
downloadpodman-c85722eb9f552f2456d33589a1417264369a6366.tar.gz
podman-c85722eb9f552f2456d33589a1417264369a6366.tar.bz2
podman-c85722eb9f552f2456d33589a1417264369a6366.zip
pod create --share none should not create infra
for podman pod create, when we are not sharing any namespaces there is no point for the infra container. This is especially true since resources have also been decoupled from the container recently. handle this on the cmd level so that we can still create infra if set explicitly resolves #15048 Signed-off-by: Charlie Doern <cdoern@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/pods/create.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index aea8a7229..4f1f66ad6 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -134,6 +134,12 @@ func create(cmd *cobra.Command, args []string) error {
imageName = infraImage
}
img := imageName
+
+ if !cmd.Flag("infra").Changed && (share == "none" || share == "") {
+ // we do not want an infra container when not sharing namespaces
+ createOptions.Infra = false
+ }
+
if !createOptions.Infra {
if cmd.Flag("no-hosts").Changed {
return fmt.Errorf("cannot specify --no-hosts without an infra container")