diff options
author | Jhon Honce <jhonce@redhat.com> | 2022-02-09 11:17:14 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2022-02-09 14:22:42 -0700 |
commit | c4676c571910d8b27ead751e35cbd877db61f8bd (patch) | |
tree | 5f921f64cb55969a87a48bedf445c8d58fe8cde8 /test/apiv2/test-apiv2 | |
parent | eb0a0db318a988af9ed70f3cc3a68f3b2bf2aa93 (diff) | |
download | podman-c4676c571910d8b27ead751e35cbd877db61f8bd.tar.gz podman-c4676c571910d8b27ead751e35cbd877db61f8bd.tar.bz2 podman-c4676c571910d8b27ead751e35cbd877db61f8bd.zip |
Add version guard to libpod API endpoints
* Ensure meaningful behaviour when called with /v3.x.x semantics
* Change return code to 409 from 500 when client attempts to use an
existing network name
* Update API bats test runner to support /v4.0.0 endpoints by default
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/apiv2/test-apiv2')
-rwxr-xr-x | test/apiv2/test-apiv2 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2 index 56280f04e..bd728e130 100755 --- a/test/apiv2/test-apiv2 +++ b/test/apiv2/test-apiv2 @@ -256,11 +256,11 @@ function t() { # If given path begins with /, use it as-is; otherwise prepend /version/ local url=http://$HOST:$PORT - if expr "$path" : "/" >/dev/null; then - url="$url$path" - else - url="$url/v1.40/$path" - fi + case "$path" in + /*) url="$url$path" ;; + libpod/*) url="$url/v4.0.0/$path" ;; + *) url="$url/v1.41/$path" ;; + esac # Log every action we do echo "-------------------------------------------------------------" >>$LOG |