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

Not able to apply annotations in particular application #383

Open
NitishGupta9282 opened this issue Oct 8, 2022 · 2 comments
Open

Not able to apply annotations in particular application #383

NitishGupta9282 opened this issue Oct 8, 2022 · 2 comments

Comments

@NitishGupta9282
Copy link

NitishGupta9282 commented Oct 8, 2022

Hi,

 I want to apply annotations on application level rather than project level. So i am trying to apply annotations in config.json file of my app, But annotations are not reflecting in UI, Its working fine when i applied annotations on project level. Code is attached below.
    {
  "appName": "sample",
  "userGivenName": "sample",
  "destNamespace": "default",
  "destServer": "https://kubernetes.default.svc",
  "srcPath": "apps/sample/overlays/lab",
  "srcRepoURL": "https://github.com/NitishGupta9282/autop.git",
  "srcTargetRevision": "",
  "labels": null,
  "annotations":
        { 
         "op": "add",
          "test": "sample"
   }
}
@philipsens

This comment was marked as outdated.

@philipsens
Copy link

philipsens commented Sep 5, 2024

Add goTemplate: true and add a templatePatch like this:

templatePatch: |
  metadata:
    annotations:
      {{- range $key, $value := .annotations }}
      {{ $key }}: {{ $value }}
      {{- end }}

This works, thanks to argoproj/argo-cd#14893.

It would be nice if this is the default for new Autopilot Applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants