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

Custom values ignored if values.yaml not present on multi source apps #18090

Open
3 tasks done
fdziarmagowski opened this issue May 6, 2024 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working component:helm component:multi-source-apps multi-source-apps Bugs or enhancements related to multi-source Applications.

Comments

@fdziarmagowski
Copy link

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
Can't add a new application when multiple sources are defined, <path>/values.yaml is not present and custom values are defined on the command line.

To Reproduce
Try to create a multi source based app and custom values file with the configuration below

Expected behavior
I would expect, that passing --values <custom file>.yaml should be sufficient to define a new application.

Screenshots

Application repo:

.
└── apps
    ├── Chart.yaml
    ├── templates
    │   └── cert-manager.yaml
    └── values-test.yaml

cert-manager.yaml:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: cert-manager
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: base-infra
  sources:
    - chart: cert-manager
      repoURL: https://charts.jetstack.io
      targetRevision: v1.14.5
      helm:
        valueFiles:
          - $values/charts/cert-manager/cert-manager-values.yaml
    - repoURL: '{{ .Values.spec.source.repoURL }}'
      targetRevision: '{{ .Values.spec.source.targetRevision }}'
      ref: values
  destination:
    server: https://kubernetes.default.svc
    namespace: cert-manager
  syncPolicy:
    automated:
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

apps/values-test.yaml:

---
spec:
  source:
    repoURL: <values repo URL>
    targetRevision: HEAD

"values" repo:

.
└── charts
    └── cert-manager
        └── cert-manager-values.yaml

charts/cert-manager/cert-manager-values.yaml:

---
installCRDs: true
prometheus:
  enabled: true

Version

argocd: v2.10.7+b060053
  BuildDate: 2024-04-15T09:05:25Z
  GitCommit: b060053b099b4c81c1e635839a309c9c8c1863e9
  GitTreeState: clean
  GoVersion: go1.21.9
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.10.7+b060053
  BuildDate: 2024-04-15T09:05:25Z
  GitCommit: b060053b099b4c81c1e635839a309c9c8c1863e9
  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.12.0
  Kubectl Version: v0.26.11
  Jsonnet Version: v0.20.0

Logs

argocd app create apps --repo <my repo> --path apps --dest-server https://kubernetes.default.svc --dest-namespace argocd --values values-test.yaml
FATA[0000] rpc error: code = InvalidArgument desc = application spec for apps is invalid: InvalidSpecError: Unable to generate manifests in apps: rpc error: code = Unknown desc = Manifest genera
tion error (cached): `helm template . --name-template apps --namespace argocd --kube-version 1.29 --values <path to cached source>/apps/values-test.yaml <api versions removed> --include-crds` fa
iled exit status 1: Error: template: applications/templates/cert-manager.yaml:19:25: executing "applications/templates/cert-manager.yaml" at <.Values.spec.source.repoURL>: can't evaluate field r
epoURL in type interface {}

Workaround

Create an empty values.yaml file in the "application" repository:

.
└── apps
    ├── Chart.yaml
    ├── templates
    │   └── cert-manager.yaml
    ├── values-test.yaml
    └── values.yaml   # THIS
@fdziarmagowski fdziarmagowski added the bug Something isn't working label May 6, 2024
@keithchong keithchong added the multi-source-apps Bugs or enhancements related to multi-source Applications. label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:helm component:multi-source-apps multi-source-apps Bugs or enhancements related to multi-source Applications.
Projects
None yet
Development

No branches or pull requests

3 participants