Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Detect and ignore HelmRelease status update
Browse files Browse the repository at this point in the history
As the update function receives any update, and we do not want to run
expensive dry-runs for status updates, but do want them for resyncs.

Theoretically this should not result in resyncs being skipped, as a
resync will redeliver a resource that was already known, which
should equal to oldFhr.Status == newFhr.Status.
  • Loading branch information
hiddeco committed May 1, 2019
1 parent 6fb2ce0 commit 00e5a09
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions integrations/helm/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,17 @@ func (c *Controller) enqueueUpdateJob(old, new interface{}) {
return
}

log := []string{"info", "enqueuing release upgrade"}
if diff := cmp.Diff(oldFhr.Spec, newFhr.Spec); diff != "" && c.logDiffs {
diff := cmp.Diff(oldFhr.Spec, newFhr.Spec)

// If the spec did not change, but the status did, we are not
// interested in doing an expensive dry-run to detect changes,
// as there probably are none.
if sDiff := cmp.Diff(oldFhr.Status, newFhr.Status); diff == "" && sDiff != "" {
return
}

log := []string{"info", "enqueuing release"}
if diff != "" && c.logDiffs {
log = append(log, "diff", diff)
}
log = append(log, "resource", newFhr.ResourceID().String())
Expand Down

0 comments on commit 00e5a09

Please sign in to comment.