Skip to content

Syncing sources in multi-source application depends on order of sources in spec. #20791

@mteodor

Description

@mteodor

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
Getting errors when trying to sync multi source application depending on the order of sources specifed.

To Reproduce
Hi All,
I have a question regarding sync for multi source application, i have app defined as follows:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: mirko-app1
spec:
  destination:
    namespace: mirko-app1
    server: https://kubernetes.default.svc/
  project: default
  sources:
  - ref: values
    repoURL: https://github.com/mteodor/argocd-example-apps
    targetRevision: multi-source
  - chart: nginx
    helm:
      valueFiles:
      - $values/helm-values/nginx-values.yaml
    repoURL: https://charts.bitnami.com/bitnami
    targetRevision: 18.2.0
  syncPolicy:
    syncOptions:
    - PrunePropagationPolicy=undefined
    - CreateNamespace=true
    - Validate=true
argocd app sync mirko-app1 --revisions multi-source --source-positions 1                                                                                          
FATA[0002] rpc error: code = FailedPrecondition desc = error resolving repo revision: rpc error: code = Unknown desc = invalid revision 'multi-source': improper constraint: multi-source  

For position 2 it works

argocd app sync mirko-app1 --revisions 18.1.2 --source-positions 2
TIMESTAMP                  GROUP                    KIND            NAMESPACE                  NAME    STATUS    HEALTH            HOOK  MESSAGE
2024-11-13T18:07:54+01:00  networking.k8s.io  NetworkPolicy        mirko-app1      mirko-app1-nginx  OutOfSync                           
2024-11-13T18:07:54+01:00  policy             PodDisruptionBudget  mirko-app1      mirko-app1-nginx  OutOfSync                           
2024-11-13T18:07:54+01:00                         Secret           mirko-app1  mirko-app1-nginx-tls  OutOfSync                           
2024-11-13T18:07:54+01:00                        Service           mirko-app1      mirko-app1-nginx  OutOfSync  Progressing              
2024-11-13T18:07:54+01:00                     ServiceAccount       mirko-app1      mirko-app1-nginx  OutOfSync   
.....

Now if i define application mirko-app2 with sources in reverse order, where helm is now on 1st pos again I'm getting an error when trying to sync on 1st position

argocd app sync mirko-app2 --revisions 18.1.2 --source-positions 1
FATA[0003] rpc error: code = FailedPrecondition desc = error resolving repo revision: rpc error: code = Unknown desc = Unable to resolve '18.1.2' to a commit SHA

Expected behavior

Screenshots

Version

argocd version
argocd: v2.12.4+27d1e64
  BuildDate: 2024-09-26T09:31:42Z
  GitCommit: 27d1e641b6ea99d9f4bf788c032aeaeefd782910
  GitTreeState: clean
  GoVersion: go1.23.1
  Compiler: gc
  Platform: darwin/arm64
argocd-server: v2.12.3+6b9cd82
  BuildDate: 2024-08-27T11:57:48Z
  GitCommit: 6b9cd828c6e9807398869ad5ac44efd2c28422d6
  GitTreeState: clean
  GoVersion: go1.22.4
  Compiler: gc
  Platform: linux/arm64
  Kustomize Version: v5.4.2 2024-05-22T15:19:38Z
  Helm Version: v3.15.2+g1a500d5
  Kubectl Version: v0.29.6
  Jsonnet Version: v0.20.0

Logs

Paste any relevant application logs here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomponent:source/helmIssue related to Helm as an Application sourcefeature:multi-sourceBugs or enhancements related to multi-source Applications.more-information-neededFurther information is requestedversion:2.13Latest confirmed affected version is 2.13

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions