Skip to content

Commit

Permalink
fix(directives): potential nil deref ArgoCD health (#2891)
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco authored Nov 4, 2024
1 parent 08ffe76 commit 1eab368
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/directives/argocd_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ func (a *argocdUpdater) getApplicationHealth(
// TODO: revisit this when https://github.com/argoproj/argo-cd/pull/18660
// is merged and released.
if app.Status.OperationState != nil {
cooldown := app.Status.OperationState.FinishedAt.Time.Add(10 * time.Second)
cooldown := time.Now()
if !app.Status.OperationState.FinishedAt.IsZero() {
cooldown = app.Status.OperationState.FinishedAt.Time
}
cooldown = cooldown.Add(10 * time.Second)
if duration := time.Until(cooldown); duration > 0 {
time.Sleep(duration)
// Re-fetch the application to get the latest state.
Expand Down

0 comments on commit 1eab368

Please sign in to comment.