Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgoCD CLI does not respect --helm-set-string during app creation #18129

Open
3 tasks done
sereneshikari opened this issue May 8, 2024 · 2 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@sereneshikari
Copy link

sereneshikari commented May 8, 2024

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

The current latest version of the ArgoCD CLI (v2.11.0) does not respect --helm-set-string during app creation.

To Reproduce

Create a Kubernetes cluster with kind (skip if you already have a cluster since this is not crucial for reproduction):

kind create cluster

Follow the official instructions to install the current latest version of ArgoCD (v2.11.0):

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.11.0/manifests/install.yaml

Download the current latest version of ArgoCD CLI (v2.11.0) and login:

curl -sSL -o argocd https://github.com/argoproj/argo-cd/releases/download/v2.11.0/argocd-linux-amd64
chmod +x ./argocd
kubectl config set-context --current --namespace=argocd
./argocd login --core

Create a test application manifest and save it to hello-world-app.yaml:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: hello-world
  namespace: argocd
spec:
  destination:
    namespace: "default"
    server: https://kubernetes.default.svc
  project: default
  sources:
  - chart: hello-world
    repoURL: https://helm.github.io/examples
    targetRevision: 0.1.0

Create the app and configure the ServiceAccount name to be foo using the --helm-set-string option:

./argocd app create -f hello-world-app.yaml --helm-set-string serviceAccount.name=foo --upsert

Sync the app:

./argocd app sync hello-world

After the app has synced, observe that the ServiceAccount name is not foo:

kubectl get sa -n default -l app.kubernetes.io/instance=hello-world

Output:

NAME          SECRETS   AGE
hello-world   0         19m

Expected behavior

--helm-set-string should be respected during app creation and the ServiceAccount name should have been foo.

Repeating the same steps above but with a different version of the ArgoCD CLI (in my case, I tried v2.7.17) resolves the issue:

image

Screenshots

image

image

Version

argocd: v2.11.0+d3f33c0
  BuildDate: 2024-05-07T16:21:23Z
  GitCommit: d3f33c00197e7f1d16f2a73ce1aeced464b07175
  GitTreeState: clean
  GoVersion: go1.21.9
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.11.0+d3f33c0
  BuildDate: 2024-05-07T16:21:23Z
  GitCommit: d3f33c00197e7f1d16f2a73ce1aeced464b07175
  GitTreeState: clean
  GoVersion: go1.21.9
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: could not get kustomize version: exec: "kustomize": executable file not found in $PATH
  Helm Version: v3.14.2+gc309b6f
  Kubectl Version: v0.26.11
  Jsonnet Version: v0.20.0

Logs

This seems to be an issue with the CLI binary rather than the server but please let me know which logs are helpful and I'll send them. Please note that running argocd app create with --loglevel debug did not print anything extra.

@sereneshikari sereneshikari added the bug Something isn't working label May 8, 2024
@sereneshikari
Copy link
Author

One more observation...

After creating the app with argocd app create and syncing it with argocd app sync, I tried to set it using argocd app set:

./argocd app set hello-world --helm-set-string serviceAccount.name=foo --loglevel debug

and I got:

FATA[0001] Source position should be specified and must be greater than 0 for applications with multiple sources

I was able to successfully set this using an older version of the CLI (v2.7.17 as also used above).
The log about "multiple sources" even though this is a single-source Application makes me wonder if this is related to #18120.

@aminebt
Copy link

aminebt commented May 21, 2024

same behavior observed with v2.11.0 --helm-set-string flags are ignored
not observed when using v2.10.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants