fix(cli): support multiple --header flags in ARGOCD_OPTS env var#27768
Open
superShen0916 wants to merge 1 commit intoargoproj:masterfrom
Open
fix(cli): support multiple --header flags in ARGOCD_OPTS env var#27768superShen0916 wants to merge 1 commit intoargoproj:masterfrom
superShen0916 wants to merge 1 commit intoargoproj:masterfrom
Conversation
✅ Preview Environment deployed on Bunnyshell
See: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #27768 +/- ##
==========================================
- Coverage 63.96% 63.94% -0.02%
==========================================
Files 421 421
Lines 57774 57775 +1
==========================================
- Hits 36954 36944 -10
- Misses 17339 17351 +12
+ Partials 3481 3480 -1 ☔ View full report in Codecov by Sentry. |
Change flags storage from map[string]string to map[string][]string to support repeated flags (e.g. --header) in ARGOCD_OPTS, matching the behavior when passed directly on the CLI. Closes argoproj#24065 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: shenpeng.sp0916 <shenpeng.sp0916@bytedance.com>
f95d6a9 to
944e62a
Compare
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.
Checklist:
fix(cli): support multiple --header flags in ARGOCD_OPTS env varWhy this PR is necessary
ARGOCD_OPTSenvironment variable does not support multiple--headerflags, unlike the CLI. This inconsistency means users who rely onARGOCD_OPTS(e.g., in CI/CD pipelines or shared environments) cannot set multiple headers without using a comma-separated workaround.What this PR solves
Fixes #24065. Changes
flagsstorage frommap[string]stringtomap[string][]stringto support repeated string slice flags (like--header) inARGOCD_OPTS. The fix is backwards compatible with existing comma-separated values and all other flag types (bool, int, string).Changes
util/config/env.go: Changedflagstomap[string][]string, updatedLoadFlags/GetFlag/GetIntFlag/GetStringSliceFlagutil/config/env_test.go: Added 4 new test cases for multi-value flagsTest plan
--header, mixed with bool flags, backwards-compatible CSV, single value