Skip to content

Support directory.recurse for plain Argo CD applications #25

@felipesdacosta

Description

@felipesdacosta

Hi @hypesystem,

We have a downstream use case where one of the generated Argo CD applications points to a plain manifest directory:

- name: prometheus-stack-overrides
  project: monitoring
  namespace: monitoring
  automated: true
  path: ../overrides/prometheus-stack/templates

Today, all manifests need to stay flat in that folder. As the monitoring setup grows, we would like to organize files into subfolders, for example:

templates/
  alerts/
    os2ai/
    platform/
  dashboards/
    os2ai/
    platform/
    common/

For Argo CD to pick up manifests recursively, the generated Application needs:

spec:
  source:
    directory:
      recurse: true

Argo CD documents this as spec.source.directory.recurse:
https://argo-cd.readthedocs.io/en/stable/user-guide/directory/#enabling-recursive-resource-detection

Would it be possible to support an optional directory field in argo-cd-resources values?

Example values:

- name: prometheus-stack-overrides
  project: monitoring
  namespace: monitoring
  automated: true
  path: ../overrides/prometheus-stack/templates
  directory:
    recurse: true

Expected rendered output:

spec:
  source:
    repoURL: ...
    path: applications/../overrides/prometheus-stack/templates
    targetRevision: HEAD
    directory:
      recurse: true

This likely only needs a small addition in vendor/applications/argo-cd-resources/templates/applications.yaml, under spec.source:

{{- with .directory }}
directory:
{{ . | toYaml | nindent 6 }}
{{- end }}

This should be backwards compatible, since existing apps without directory would render exactly as today.

This would help us keep plain manifest overrides better organized without patching the vendored chart locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions