Skip to content

Commit ec22c83

Browse files
committed
fix: reuse PLUGIN_REGISTRY for IMAGE_REPO construction
Ensure IMAGE_REPO and PLUGIN_REGISTRY use the same registry domain by constructing IMAGE_REPO from PLUGIN_REGISTRY when not explicitly set. Before: - IMAGE_REPO and PLUGIN_REGISTRY were set independently - Could potentially use different registries - Duplicated registry domain logic After: - PLUGIN_REGISTRY is detected first (via detectPluginRegistry) - IMAGE_REPO is built from PLUGIN_REGISTRY: ${PLUGIN_REGISTRY}/higress/all-in-one - Ensures both use the same geographically optimal registry Behavior: 1. User sets IMAGE_REPO explicitly → use user's value (backward compatible) 2. User doesn't set IMAGE_REPO → construct from PLUGIN_REGISTRY (DRY) Benefits: - Single source of truth for registry domain (PLUGIN_REGISTRY) - No duplicate registry selection logic - Container image and plugins always use same registry - Maintains backward compatibility with explicit IMAGE_REPO
1 parent 123aa03 commit ec22c83

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

all-in-one/get-ai-gateway.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,15 @@ resetEnv() {
562562
DATA_FOLDER="$ROOT"
563563
CONTAINER_NAME="${CONTAINER_NAME:-$DEFAULT_CONTAINER_NAME}"
564564

565-
IMAGE_REPO="${IMAGE_REPO:-$DEFAULT_IMAGE_REPO}"
566-
IMAGE_TAG="${IMAGE_TAG:-$DEFAULT_IMAGE_TAG}"
567-
568-
# Detect and set plugin registry if not already set
565+
# Detect and set plugin registry first (before IMAGE_REPO)
569566
detectPluginRegistry
570567
PLUGIN_REGISTRY="${PLUGIN_REGISTRY:-$DEFAULT_PLUGIN_REGISTRY}"
568+
569+
# Build IMAGE_REPO from PLUGIN_REGISTRY if not explicitly set
570+
if [ -z "$IMAGE_REPO" ]; then
571+
IMAGE_REPO="${PLUGIN_REGISTRY}/higress/all-in-one"
572+
fi
573+
IMAGE_TAG="${IMAGE_TAG:-$DEFAULT_IMAGE_TAG}"
571574

572575
GATEWAY_HTTP_PORT="${GATEWAY_HTTP_PORT:-$DEFAULT_GATEWAY_HTTP_PORT}"
573576
GATEWAY_HTTPS_PORT="${GATEWAY_HTTPS_PORT:-$DEFAULT_GATEWAY_HTTPS_PORT}"

0 commit comments

Comments
 (0)