fix: reuse PLUGIN_REGISTRY for IMAGE_REPO construction#240
Merged
Conversation
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
johnlanni
added a commit
to higress-group/higress
that referenced
this pull request
Feb 2, 2026
Simplify environment variables documentation to only expose PLUGIN_REGISTRY, which now controls both container images and plugins. Changes: - Remove IMAGE_REPO from Environment Variables table - Update description: PLUGIN_REGISTRY controls both images and plugins - Simplify auto-selection logic explanation - Update manual override example to only use PLUGIN_REGISTRY Rationale: - After higress-group/higress-standalone#240, IMAGE_REPO is derived from PLUGIN_REGISTRY automatically - Users only need to set PLUGIN_REGISTRY to control registry selection - Simpler interface, single source of truth Related: higress-group/higress-standalone#240
4 tasks
|
CodeReview流程已终止 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #239,
IMAGE_REPOandPLUGIN_REGISTRYare set independently, which means:Solution
Reuse
PLUGIN_REGISTRYwhen constructingIMAGE_REPO:Changes
Reorder in
resetEnv():PLUGIN_REGISTRYfirstIMAGE_REPOfrom itConditional IMAGE_REPO construction:
IMAGE_REPOexplicitly set → use it (backward compatible)PLUGIN_REGISTRYBenefits
✅ Single source of truth - Registry domain only detected once
✅ Guaranteed consistency - Container image and plugins always use same registry
✅ DRY principle - No duplicate timezone → registry mapping logic
✅ Backward compatible - Users can still override
IMAGE_REPOexplicitlyExample Behavior
Auto-detection (typical):
Explicit override (advanced):
Partial override (typical):
Testing
bash -n)Related