diff options
author | Niall Crowe <nicrowe@redhat.com> | 2022-08-16 15:38:59 +0100 |
---|---|---|
committer | Niall Crowe <nicrowe@redhat.com> | 2022-08-23 12:55:53 +0100 |
commit | 5f719b533ec6468911a284f2d901d65c098f4539 (patch) | |
tree | 6c8f908c31f32f6eaf89cdb2c117058a987d7fe3 /test | |
parent | 498fe67ef7050f4cf7849a5c5545cbe5a9dd9cd8 (diff) | |
download | podman-5f719b533ec6468911a284f2d901d65c098f4539.tar.gz podman-5f719b533ec6468911a284f2d901d65c098f4539.tar.bz2 podman-5f719b533ec6468911a284f2d901d65c098f4539.zip |
podman kube play/down --read from URL
`podman kube play` can create pods and containers from YAML
read from a URL poiniting to a YAML file.
For example: `podman kube play https://example.com/demo.yml`.
`podman kube down` can also teardown pods and containers created
from that YAML file by also reading YAML from a URL, provided the
YAML file the URL points to has not been changed or altered since
it was used to create pods and containers
Closes #14955
Signed-off-by: Niall Crowe <nicrowe@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/system/700-play.bats | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/system/700-play.bats b/test/system/700-play.bats index e1955cfd1..bad9544ff 100644 --- a/test/system/700-play.bats +++ b/test/system/700-play.bats @@ -361,3 +361,28 @@ status: {} run_podman pod rm -a run_podman rm -a } + +@test "podman kube play - URL" { + TESTDIR=$PODMAN_TMPDIR/testdir + mkdir -p $TESTDIR + echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml + + HOST_PORT=$(random_free_port) + SERVER=http://127.0.0.1:$HOST_PORT + + run_podman run -d --name myyaml -p "$HOST_PORT:80" \ + -v $PODMAN_TMPDIR/test.yaml:/var/www/testpod.yaml:Z \ + -w /var/www \ + $IMAGE /bin/busybox-extras httpd -f -p 80 + + run_podman kube play $SERVER/testpod.yaml + run_podman inspect test_pod-test --format "{{.State.Running}}" + is "$output" "true" + run_podman kube down $SERVER/testpod.yaml + run_podman 125 inspect test_pod-test + is "$output" ".*Error: inspecting object: no such object: \"test_pod-test\"" + + run_podman pod rm -a -f + run_podman rm -a -f + run_podman rm -f -t0 myyaml +} |