Skip to content

fix(cli): support multiple --header flags in ARGOCD_OPTS Fixes #24065#2

Open
Bharath420 wants to merge 1 commit intomasterfrom
fix-argocd-opts-multiple-headers
Open

fix(cli): support multiple --header flags in ARGOCD_OPTS Fixes #24065#2
Bharath420 wants to merge 1 commit intomasterfrom
fix-argocd-opts-multiple-headers

Conversation

@Bharath420
Copy link
Copy Markdown
Owner

Fixes argoproj#24065

Summary

The ARGOCD_OPTS environment variable now correctly handles multiple instances of the same flag (e.g., multiple --header flags) by concatenating values with commas, making it consistent with direct CLI usage.

Problem

The argocd CLI accepts the --header option multiple times when passed directly on the command line. However, when using the ARGOCD_OPTS environment variable, only a single --header is recognized. This is inconsistent with CLI behavior.

Current behavior:

# Works - both headers sent
argocd app list --header "CF-Access-Client-Id: foo" --header "CF-Access-Client-Secret: bar"

# Broken - only last header sent
export ARGOCD_OPTS='--header "CF-Access-Client-Id: foo" --header "CF-Access-Client-Secret: bar"'
argocd app list

…oj#24065

The ARGOCD_OPTS environment variable now correctly handles multiple
instances of the same flag (e.g., multiple --header flags) by
concatenating values with commas, making it consistent with direct
CLI usage.

Signed-off-by: Bharath Madvar <39058743+Bharath420@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARGOCD_OPTS does not accept --header parameter multiple times

1 participant