diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-27 22:21:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 22:21:54 +0200 |
commit | dca5ead2d7ad8ac3b14fed6736c102b571d8baf1 (patch) | |
tree | 5d36a6115eb6e17ad8f0531920631b6f9a7a3674 /test/system | |
parent | b794b61817e944ebd22fc74f62f54960877fe6db (diff) | |
parent | f5fc0960e5eddf64a7d8fbf8fbfd3652b4ee5db3 (diff) | |
download | podman-dca5ead2d7ad8ac3b14fed6736c102b571d8baf1.tar.gz podman-dca5ead2d7ad8ac3b14fed6736c102b571d8baf1.tar.bz2 podman-dca5ead2d7ad8ac3b14fed6736c102b571d8baf1.zip |
Merge pull request #15946 from rhatdan/kube
Default missing hostPort to containerPort is defined in kube.yaml
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/700-play.bats | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/system/700-play.bats b/test/system/700-play.bats index bad9544ff..578d28394 100644 --- a/test/system/700-play.bats +++ b/test/system/700-play.bats @@ -386,3 +386,27 @@ status: {} run_podman rm -a -f run_podman rm -f -t0 myyaml } + +@test "podman kube play - hostport" { + HOST_PORT=$(random_free_port) + echo " +apiVersion: v1 +kind: Pod +metadata: + labels: + app: test + name: test_pod +spec: + containers: + - name: server + image: $IMAGE + ports: + - name: hostp + containerPort: $HOST_PORT +" > $PODMAN_TMPDIR/testpod.yaml + + run_podman kube play $PODMAN_TMPDIR/testpod.yaml + run_podman pod inspect test_pod --format "{{.InfraConfig.PortBindings}}" + assert "$output" = "map[$HOST_PORT/tcp:[{ $HOST_PORT}]]" + run_podman kube down $PODMAN_TMPDIR/testpod.yaml +} |