Skip to content

Commit

Permalink
Cirrus: Fix missing htpasswd in registry img
Browse files Browse the repository at this point in the history
Recently the registry image was updated significantly with breaking
changes.  Most were caught, this one was not.  Instead of relying on the
(clearly) unreliable container image, simply install the package
providing the htpasswd command locally.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Jun 29, 2020
1 parent 9fd14e6 commit ca98619
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contrib/cirrus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ else
showrun make install PREFIX=/usr
showrun ./bin/buildah info
else
ln -v ${CROSS_TARGET} bin/buildah
ln -sv ../buildah bin/buildah
fi
fi
6 changes: 2 additions & 4 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,10 @@ execute_local_registry() {
cp $authdirpath/domain.crt $certdirpath/localhost:5000/domain.crt
echo "Creating http credentials file"
podman run --entrypoint htpasswd $REGISTRY_FQIN \
-Bbn testuser testpassword \
> $authdirpath/htpasswd
showrun htpasswd -Bbn testuser testpassword > $authdirpath/htpasswd
echo "Starting up the local 'registry' container"
podman run -d -p 5000:5000 --name registry \
showrun podman run -d -p 5000:5000 --name registry \
-v $authdirpath:$authdirpath:Z \
-e "REGISTRY_AUTH=htpasswd" \
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
Expand Down
5 changes: 4 additions & 1 deletion contrib/cirrus/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ case "$OS_RELEASE_ID" in
if [[ -z "$CONTAINER" ]]; then
warn "Adding secondary testing partition & growing root filesystem"
bash $SCRIPT_BASE/add_second_partition.sh

warn "TODO: Add httpd-tools (for htpasswd) to VM images (in libpod repo)"
dnf install -y httpd-tools
fi

warn "Hard-coding podman to use crun"
Expand All @@ -35,7 +38,7 @@ case "$OS_RELEASE_ID" in
# Executing tests in a container requires SELinux boolean set on the host
if [[ "$IN_PODMAN" == "true" ]]
then
setsebool -P container_manage_cgroup true
showrun setsebool -P container_manage_cgroup true
fi
;;
ubuntu)
Expand Down

0 comments on commit ca98619

Please sign in to comment.