summaryrefslogtreecommitdiff
path: root/hack/podman-registry
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-26 11:28:07 -0400
committerGitHub <noreply@github.com>2020-05-26 11:28:07 -0400
commit07ef44e2f3e4162fc28c3f3edcd739ab6e51526a (patch)
tree626911d289af9d4e52a60f508accad4841b92f31 /hack/podman-registry
parent5c10533d49314f78fffa983bd0e1a060322b505b (diff)
parentb81b865b5287fd07b4e6fb73753cab788ae76edc (diff)
downloadpodman-07ef44e2f3e4162fc28c3f3edcd739ab6e51526a.tar.gz
podman-07ef44e2f3e4162fc28c3f3edcd739ab6e51526a.tar.bz2
podman-07ef44e2f3e4162fc28c3f3edcd739ab6e51526a.zip
Merge pull request #6390 from edsantiago/registry_show_errors
podman-registry: fix lost credentials
Diffstat (limited to 'hack/podman-registry')
-rwxr-xr-xhack/podman-registry17
1 files changed, 11 insertions, 6 deletions
diff --git a/hack/podman-registry b/hack/podman-registry
index 79dff8b70..fe79b7d9d 100755
--- a/hack/podman-registry
+++ b/hack/podman-registry
@@ -14,7 +14,7 @@ PODMAN_REGISTRY_PASS=
PODMAN_REGISTRY_PORT=
# Podman binary to run
-PODMAN=${PODMAN:-$(type -p podman)}
+PODMAN=${PODMAN:-$(dirname $0)/../bin/podman}
# END defaults
###############################################################################
@@ -176,11 +176,16 @@ function do_start() {
-out ${AUTHDIR}/domain.crt \
-subj "/C=US/ST=Foo/L=Bar/O=Red Hat, Inc./CN=localhost"
- # Store credentials where container will see them
- must_pass podman run --rm \
- --entrypoint htpasswd ${PODMAN_REGISTRY_IMAGE} \
- -Bbn ${PODMAN_REGISTRY_USER} ${PODMAN_REGISTRY_PASS} \
- > $AUTHDIR/htpasswd
+ # Store credentials where container will see them. We can't run
+ # this one via must_pass because we need its stdout.
+ podman run --rm \
+ --entrypoint htpasswd ${PODMAN_REGISTRY_IMAGE} \
+ -Bbn ${PODMAN_REGISTRY_USER} ${PODMAN_REGISTRY_PASS} \
+ > $AUTHDIR/htpasswd
+ if [ $? -ne 0 ]; then
+ rm -rf ${PODMAN_REGISTRY_WORKDIR}
+ die "Command failed: podman run [htpasswd]"
+ fi
# In case someone needs to debug
echo "${PODMAN_REGISTRY_USER}:${PODMAN_REGISTRY_PASS}" \