From d3311a06230f2fabee403d06f5dd36d7338cc34b Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 24 Jun 2020 13:11:01 -0600 Subject: [PATCH] buildah test helper: run registry:2.6, not :2 The docker.io/registry:2 image broke suddenly and with no warning: https://github.com/docker/distribution-library-image/issues/106 Symptom: running 'htpasswd' from that container no longer works, even though it's been documented for years (at docker.com) and as of this writing still remains documented. One solution is to run htpasswd locally (requires installing the httpd-tools package) or using any crypt library to hash. Not hard, but tedious, and it doesn't address the issue of the docker registry:2 image being a moving target. I choose to force the use of the :2.6 tag, in hopes that that image will remain unmodified. Refactored to use FQIN instead of shortname, and to define it in only one place. Signed-off-by: Ed Santiago --- tests/test_buildah.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_buildah.sh b/tests/test_buildah.sh index 2227107..6a064be 100755 --- a/tests/test_buildah.sh +++ b/tests/test_buildah.sh @@ -19,6 +19,8 @@ export IMGTYPE_BINARY=/usr/bin/buildah-imgtype # Start a registry pre_bats_setup() { + REGISTRY_FQIN=docker.io/library/registry:2.6 + AUTHDIR=/tmp/buildah-tests-auth.$$ mkdir -p $AUTHDIR @@ -31,7 +33,7 @@ pre_bats_setup() { fi if [ ! -e $AUTHDIR/htpasswd ]; then - podman run --rm --entrypoint htpasswd registry:2 \ + podman run --rm --entrypoint htpasswd $REGISTRY_FQIN \ -Bbn testuser testpassword > $AUTHDIR/htpasswd fi @@ -44,7 +46,7 @@ pre_bats_setup() { -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \ -e REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt \ -e REGISTRY_HTTP_TLS_KEY=/auth/domain.key \ - registry:2 + $REGISTRY_FQIN } post_bats_teardown() {