Skip to content

Post-Delete Hook support mutate Application object #17433

@llavaud

Description

@llavaud

Describe the bug

The recent Post-Delete hook support PR, mutate the Application object when refreshing by adding two finalizers if a resource have a "helm.sh/hook": post-delete annotation.
In an apps of apps context it causes unnecesssary reconciliations due to object updated:

{"api-version":"argoproj.io/v1alpha1","application":"myRootApp","cluster-name":"myCluster","fields.level":0,"kind":"Application","level":"debug","msg":"Requesting app refresh caused by object update","name":"myApp","namespace":"argo-cd","server":"myServer","time":"2024-03-07T08:14:40Z"}

To Reproduce

Create an Application that deploy another Application, in the nested Application deploy a resource that have a "helm.sh/hook": post-delete annotation. Wait for the 3m default refresh interval and search for the Requesting app refresh caused by object update debug log line.

Expected behavior

Do not mutate the Application object or at least maybe automaticaly ignore thoses finalizers like it is currently done for the metadata fields generation and resourceVersion

Version

argocd: v2.10.2+fcf5d8c
  BuildDate: 2024-03-01T21:24:51Z
  GitCommit: fcf5d8c2381b68ab1621b90be63913b12cca2eb7
  GitTreeState: clean
  GoVersion: go1.21.3
  Compiler: gc
  Platform: linux/amd64

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcomponent:application-controllerIssues related to the Application Controller componentcomponent:source/helmIssue related to Helm as an Application sourcefeature:hooksIssue related to Argo Sync or Helm hooksgood first issueGood for newcomerstriage/high-trafficIssues with many comments, commented with TLDR of clear action items or closed with clear reasonversion:2.14Latest confirmed affected version is 2.14version:3.0Latest confirmed affected version is 3.0

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions