argoproj / gitops-engine

Democratizing GitOps
https://pkg.go.dev/github.com/argoproj/gitops-engine?tab=subdirectories
Apache License 2.0
1.68k stars 252 forks source link

fix: hook lifecycle management was flaky #482

Open jessesuen opened 1 year ago

jessesuen commented 1 year ago

Occasionally hooks such as a PreSyncHook which had hook-delete-policy: BeforeHookCreation could get into a situation where the hook was forever stuck in "Pending deletion". This is despite the fact that the actual resource (e.g. Job) had successfully been deleted. This was intermittent and would only get stuck once in a while.

This change reworks the sync logic slightly such that we allow the Sync() logic to progress further down the method, into the portion of code that handles hook lifecycle. By doing so, we will attempt to manage a hook's lifecycle (deleted/created/etc...)

This is still being tested fully.

Signed-off-by: Jesse Suen jesse@akuity.io

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.2% 0.2% Duplication