mirror of https://github.com/containers/podman.git
Merge pull request #14552 from edsantiago/apiv2_test_panic_fix
APIv2 tests: (try to) fix flaky registry panic
This commit is contained in:
commit
6a2c0e9601
|
@ -443,12 +443,18 @@ function start_registry() {
|
||||||
# If invoked with auth=htpasswd, create credentials
|
# If invoked with auth=htpasswd, create credentials
|
||||||
REGISTRY_USERNAME=
|
REGISTRY_USERNAME=
|
||||||
REGISTRY_PASSWORD=
|
REGISTRY_PASSWORD=
|
||||||
|
declare -a registry_auth_params=(-e "REGISTRY_AUTH=$auth")
|
||||||
if [[ "$auth" = "htpasswd" ]]; then
|
if [[ "$auth" = "htpasswd" ]]; then
|
||||||
REGISTRY_USERNAME=u$(random_string 7)
|
REGISTRY_USERNAME=u$(random_string 7)
|
||||||
REGISTRY_PASSWORD=p$(random_string 7)
|
REGISTRY_PASSWORD=p$(random_string 7)
|
||||||
|
|
||||||
htpasswd -Bbn ${REGISTRY_USERNAME} ${REGISTRY_PASSWORD} \
|
htpasswd -Bbn ${REGISTRY_USERNAME} ${REGISTRY_PASSWORD} \
|
||||||
> $AUTHDIR/htpasswd
|
> $AUTHDIR/htpasswd
|
||||||
|
|
||||||
|
registry_auth_params+=(
|
||||||
|
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm"
|
||||||
|
-e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd"
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run the registry, and wait for it to come up
|
# Run the registry, and wait for it to come up
|
||||||
|
@ -456,9 +462,7 @@ function start_registry() {
|
||||||
-p ${REGISTRY_PORT}:5000 \
|
-p ${REGISTRY_PORT}:5000 \
|
||||||
--name registry \
|
--name registry \
|
||||||
-v $AUTHDIR:/auth:Z \
|
-v $AUTHDIR:/auth:Z \
|
||||||
-e "REGISTRY_AUTH=$auth" \
|
"${registry_auth_params[@]}" \
|
||||||
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
|
|
||||||
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
|
|
||||||
-e REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt \
|
-e REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt \
|
||||||
-e REGISTRY_HTTP_TLS_KEY=/auth/domain.key \
|
-e REGISTRY_HTTP_TLS_KEY=/auth/domain.key \
|
||||||
${REGISTRY_IMAGE}
|
${REGISTRY_IMAGE}
|
||||||
|
|
Loading…
Reference in New Issue