argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

the Argo CD API does not currently support creating ApplicationSets with templated `project` fields"

Open sahotay opened this issue 2 years ago • 5 comments

Summary

Is it possible to add feature to create ApplicationSet with templated project files

Error:

FATA[0001] rpc error: code = Unknown desc = error validating ApplicationSets: the Argo CD API does not currently support creating ApplicationSets with templated `project` fields 

sahotay avatar May 19 '23 18:05 sahotay

Additional context here: https://github.com/argoproj/argo-cd/pull/9584#pullrequestreview-1059424970

morey-tech avatar Jun 06 '23 16:06 morey-tech

thanks @morey-tech Do you know if this feature got added ? i see this is part of the documentation now but it seems i do get the same error

project refers to the [Argo CD Project](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/) in use (default may be used here to utilize the default Argo CD Project)

sahotay avatar Sep 13 '23 15:09 sahotay

@sahotay I believe the spec.template.spec.project field still can not be templated. Also, the ApplicationSet documentation has been moved into the Argo CD docs, so this would be the correct page now. That section describes what the spec.template fields of the ApplicationSet relate to on an Application. The docs could use an enhancement to clarify that you can't template that field.

morey-tech avatar Sep 13 '23 15:09 morey-tech

Managed to get around this via generators template:

spec:
  generators:
  - list:
      elements:
      - project: serviceentry
        extraParam: a
      - project: default
        extraParam: b
      template:
        spec:
          project: '{{project}}'
  template:
    spec:
      project: default

Project is correctly replaced then.

dyatlov avatar Sep 20 '23 12:09 dyatlov

Managed to get around this via generators template:

spec:
  generators:
  - list:
      elements:
      - project: serviceentry
        extraParam: a
      - project: default
        extraParam: b
      template:
        spec:
          project: '{{project}}'
  template:
    spec:
      project: default

Project is correctly replaced then.

Is this possible with the git directory generator as well?

jasperjorna avatar Mar 07 '24 20:03 jasperjorna