aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/domain/infra/abi/play.go4
-rw-r--r--test/system/700-play.bats10
2 files changed, 8 insertions, 6 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index 4a83cb464..8779acfda 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -344,10 +344,6 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
return nil, err
}
- if (ns.IsBridge() && len(networks) == 0) || ns.IsHost() {
- return nil, fmt.Errorf("invalid value passed to --network: bridge or host networking must be configured in YAML")
- }
-
podOpt.Net.Network = ns
podOpt.Net.Networks = networks
podOpt.Net.NetworkOptions = netOpts
diff --git a/test/system/700-play.bats b/test/system/700-play.bats
index 578d28394..5f3eb1ef2 100644
--- a/test/system/700-play.bats
+++ b/test/system/700-play.bats
@@ -165,8 +165,14 @@ EOF
TESTDIR=$PODMAN_TMPDIR/testdir
mkdir -p $TESTDIR
echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
- run_podman 125 kube play --network host $PODMAN_TMPDIR/test.yaml
- is "$output" ".*invalid value passed to --network: bridge or host networking must be configured in YAML" "podman plan-network should fail with --network host"
+ run_podman kube play --network host $PODMAN_TMPDIR/test.yaml
+ is "$output" "Pod:.*" "podman kube play should work with --network host"
+
+ run_podman pod inspect --format "{{.InfraConfig.HostNetwork}}" test_pod
+ is "$output" "true" ".InfraConfig.HostNetwork"
+ run_podman stop -a -t 0
+ run_podman pod rm -t 0 -f test_pod
+
run_podman kube play --network slirp4netns:port_handler=slirp4netns $PODMAN_TMPDIR/test.yaml
run_podman pod inspect --format {{.InfraContainerID}} "${lines[1]}"
infraID="$output"