aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-09-26 13:00:17 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-09-26 17:07:05 +0200
commit7bc36602f6c407cffdc799ca1b2fc7c00bc4f93b (patch)
tree6149fd0c1e3a8fed2aaa07c82cbe1331e1085408 /test
parent17f3756884f2f65a1da753e5b58895dc0b9145e8 (diff)
downloadpodman-7bc36602f6c407cffdc799ca1b2fc7c00bc4f93b.tar.gz
podman-7bc36602f6c407cffdc799ca1b2fc7c00bc4f93b.tar.bz2
podman-7bc36602f6c407cffdc799ca1b2fc7c00bc4f93b.zip
auto-update: validate container image
Auto updates using the "registry" policy require container to be created with a fully-qualified image reference. Short names are not supported due the ambiguity of their source registry. Initially, container creation errored out for non FQN images but it seems that Podman has regressed. Fixes: #15879 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/255-auto-update.bats20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/system/255-auto-update.bats b/test/system/255-auto-update.bats
index 76f6b02e8..6f5113779 100644
--- a/test/system/255-auto-update.bats
+++ b/test/system/255-auto-update.bats
@@ -133,6 +133,26 @@ function _confirm_update() {
die "Timed out waiting for $cname to update; old IID=$old_iid"
}
+@test "podman auto-update - validate input" {
+ # Fully-qualified image reference is required
+ run_podman create --label io.containers.autoupdate=registry $IMAGE
+ run_podman rm -f "$output"
+
+ # Short name does not work
+ shortname="shortname:latest"
+ run_podman image tag $IMAGE $shortname
+ run_podman 125 create --label io.containers.autoupdate=registry $shortname
+ is "$output" "Error: short name: auto updates require fully-qualified image reference: \"$shortname\""
+
+ # Requires docker (or no) transport
+ archive=$PODMAN_TMPDIR/archive.tar
+ run_podman save -o $archive $IMAGE
+ run_podman 125 create --label io.containers.autoupdate=registry docker-archive:$archive
+ is "$output" ".*Error: auto updates require the docker image transport but image is of transport \"docker-archive\""
+
+ run_podman rmi $shortname
+}
+
# This test can fail in dev. environment because of SELinux.
# quick fix: chcon -t container_runtime_exec_t ./bin/podman
@test "podman auto-update - label io.containers.autoupdate=image" {