fix: pull registry-aware image name on local miss
When `image-repo` is overridden, the registry plugin pushes under that name and
the bare local `dokku/<app>:N` tag is never created. `fn-verify-app-image` now
queries the `deployed-app-image-repo` trigger and pulls `${REMOTE_REPO}${DEPLOYED_REPO}:${TAG}`,
retagging it as the local bare reference so subsequent inspects resolve. Also
aligns the `storage:ensure-directory` deprecation test assertion with the
standardized `Deprecated:` prefix.
This commit is contained in:
@@ -311,16 +311,18 @@ fn-verify-app-image() {
|
||||
DOCKER_CONFIG="$(fn-registry-docker-config-dir "$APP")"
|
||||
[[ -n "$DOCKER_CONFIG" ]] && export DOCKER_CONFIG
|
||||
|
||||
local REMOTE_REPO
|
||||
local REMOTE_REPO DEPLOYED_REPO TAG
|
||||
REMOTE_REPO="$(plugn trigger deployed-app-repository "$APP")"
|
||||
DEPLOYED_REPO="$(plugn trigger deployed-app-image-repo "$APP")"
|
||||
TAG="${IMAGE##*:}"
|
||||
|
||||
dokku_log_info1 "Image $IMAGE not found locally, pulling from registry" 1>&2
|
||||
if [[ "$IMAGE" == "${REMOTE_REPO}"* ]]; then
|
||||
if [[ -n "$DEPLOYED_REPO" ]] && [[ "$IMAGE" == "${REMOTE_REPO}${DEPLOYED_REPO}:"* ]]; then
|
||||
"$DOCKER_BIN" image pull "$IMAGE" 1>&2 && return 0
|
||||
return 1
|
||||
fi
|
||||
|
||||
local REMOTE_IMAGE="${REMOTE_REPO}${IMAGE}"
|
||||
local REMOTE_IMAGE="${REMOTE_REPO}${DEPLOYED_REPO:-${IMAGE%:*}}:${TAG}"
|
||||
if "$DOCKER_BIN" image pull "$REMOTE_IMAGE" 1>&2; then
|
||||
"$DOCKER_BIN" image tag "$REMOTE_IMAGE" "$IMAGE" 1>&2 && return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user