From ec22c836b2eed518e67c20d3fd3eaf59c67eb92a Mon Sep 17 00:00:00 2001 From: johnlanni Date: Mon, 2 Feb 2026 11:31:36 +0800 Subject: [PATCH] fix: reuse PLUGIN_REGISTRY for IMAGE_REPO construction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- all-in-one/get-ai-gateway.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/all-in-one/get-ai-gateway.sh b/all-in-one/get-ai-gateway.sh index c658dd7..1340f0e 100755 --- a/all-in-one/get-ai-gateway.sh +++ b/all-in-one/get-ai-gateway.sh @@ -562,12 +562,15 @@ resetEnv() { DATA_FOLDER="$ROOT" CONTAINER_NAME="${CONTAINER_NAME:-$DEFAULT_CONTAINER_NAME}" - IMAGE_REPO="${IMAGE_REPO:-$DEFAULT_IMAGE_REPO}" - IMAGE_TAG="${IMAGE_TAG:-$DEFAULT_IMAGE_TAG}" - - # Detect and set plugin registry if not already set + # Detect and set plugin registry first (before IMAGE_REPO) detectPluginRegistry PLUGIN_REGISTRY="${PLUGIN_REGISTRY:-$DEFAULT_PLUGIN_REGISTRY}" + + # Build IMAGE_REPO from PLUGIN_REGISTRY if not explicitly set + if [ -z "$IMAGE_REPO" ]; then + IMAGE_REPO="${PLUGIN_REGISTRY}/higress/all-in-one" + fi + IMAGE_TAG="${IMAGE_TAG:-$DEFAULT_IMAGE_TAG}" GATEWAY_HTTP_PORT="${GATEWAY_HTTP_PORT:-$DEFAULT_GATEWAY_HTTP_PORT}" GATEWAY_HTTPS_PORT="${GATEWAY_HTTPS_PORT:-$DEFAULT_GATEWAY_HTTPS_PORT}"