argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18k stars 5.48k forks source link

v2.9.3 generators - pathParam bug - only reads/use the first pathParam in generators #16848

Open gabrielfsousa opened 10 months ago

gabrielfsousa commented 10 months ago

Generators only use the first pathParam.

WONT WORK

Generators:

spec:
  goTemplate: true
  generators:
    - merge:
        mergeKeys:
          - merge
        generators:
        - git:
            repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-cpm
            revision: HEAD
            files:
            - path: "elastic-agent/base/conf.yaml"
        - matrix:
            generators:
            - git:
                repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-cpm
                revision: HEAD
                files:
                - path: "elastic-agent/targets/**/conf.yaml"
                pathParamPrefix: targets
            - git:
                repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-k8s-clusters
                revision: HEAD
                files:
                - path: "targets/{{index .targets.path.segments 2}}/{{index .targets.path.segments 3}}/*.yaml"
                pathParamPrefix: clusters

Log: image

WORKS

Generators: this works, but i cant use because i need "../targets/**/conf.yaml" to override "../base/conf.yaml"

spec:
  goTemplate: true
  generators:
    - merge:
        mergeKeys:
          - merge
        generators:
        - matrix:
            generators:
            - git:
                repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-cpm
                revision: HEAD
                files:
                - path: "weave-scope/targets/**/conf.yaml"
                pathParamPrefix: targets
            - git:
                repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-k8s-clusters
                revision: HEAD
                files:
                - path: "targets/{{index .targets.path.segments 2}}/{{index .targets.path.segments 3}}/*.yaml"
                pathParamPrefix: clusters
        - git:
            repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-cpm
            revision: HEAD
            files:
            - path: "weave-scope/base/conf.yaml"

also work with only matrix

spec:
  goTemplate: true
  generators:
  - matrix:
      generators:
      - git:
          repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-cpm
          revision: 'master'
          files:
          - path: "k8spacket/targets/**/conf.yaml"
          pathParamPrefix: targets
      - git:
          repoURL: git@ssh.dev.azure.com:v3/NAME/GitOps/dr-k8s-clusters
          revision: 'master'
          files:
          - path: "targets/{{index .targets.path.segments 2}}/{{index .targets.path.segments 3}}/*.yaml"
          pathParamPrefix: clusters
gabrielfsousa commented 7 months ago

PLEASE fix this !

andrii-korotkov-verkada commented 1 week ago

ArgoCD versions 2.10 and below have reached EOL. Can you upgrade and let us know if the issue is still present, please?