Skip to content

Commit

Permalink
reconcile: remove stale TestSuccess condition
Browse files Browse the repository at this point in the history
When a Helm install or upgrade is performed, to prevent confusion due to
reporting a stale test result.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco committed Dec 7, 2023
1 parent 842a942 commit 3fdfe9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/reconcile/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ func (r *Install) Reconcile(ctx context.Context, req *Request) error {
// before the install.
req.Object.Status.ClearHistory()

// If we are installing, we are no longer remediated.
// If we are installing, none of the previous conditions apply.
conditions.Delete(req.Object, v2.TestSuccessCondition)
conditions.Delete(req.Object, v2.RemediatedCondition)

// Run the Helm install action.
Expand Down
3 changes: 2 additions & 1 deletion internal/reconcile/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ func (r *Upgrade) Reconcile(ctx context.Context, req *Request) error {
// Mark upgrade attempt on object.
req.Object.Status.LastAttemptedReleaseAction = v2.ReleaseActionUpgrade

// If we are upgrading, we are no longer remediated.
// If we are upgrading, none of the previous conditions apply.
conditions.Delete(req.Object, v2.TestSuccessCondition)
conditions.Delete(req.Object, v2.RemediatedCondition)

// Run the Helm upgrade action.
Expand Down

0 comments on commit 3fdfe9f

Please sign in to comment.