Skip to content

Commit

Permalink
fix: artifact GC.
Browse files Browse the repository at this point in the history
Signed-off-by: shuangkun <[email protected]>
  • Loading branch information
shuangkun committed Mar 21, 2024
1 parent 87899e5 commit cb98804
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"golang.org/x/exp/slices"
"math"
"os"
"reflect"
Expand Down Expand Up @@ -806,6 +807,10 @@ func (woc *wfOperationCtx) persistUpdates(ctx context.Context) {
woc.log.WithError(err).Warn("failed to delete task-results")
}
}
// If FinalizerArtifactGC exists, requeue to make sure artifact GC can execute.
if woc.wf.Status.Fulfilled() && slices.Contains(wf.GetFinalizers(), common.FinalizerArtifactGC) {
woc.requeue()
}

// It is important that we *never* label pods as completed until we successfully updated the workflow
// Failing to do so means we can have inconsistent state.
Expand Down

0 comments on commit cb98804

Please sign in to comment.