diff --git a/workflow/controller/artifact_gc.go b/workflow/controller/artifact_gc.go index cc98a422d7dd..3da197fb119b 100644 --- a/workflow/controller/artifact_gc.go +++ b/workflow/controller/artifact_gc.go @@ -508,7 +508,6 @@ func (woc *wfOperationCtx) processArtifactGCCompletion(ctx context.Context) erro return fmt.Errorf("failed to get pods from informer: %w", err) } - anyPodSuccess := false for _, obj := range pods { pod := obj.(*corev1.Pod) if pod.Labels[common.LabelKeyComponent] != artifactGCComponent { // make sure it's an Artifact GC Pod @@ -535,9 +534,6 @@ func (woc *wfOperationCtx) processArtifactGCCompletion(ctx context.Context) erro return err } woc.wf.Status.ArtifactGCStatus.SetArtifactGCPodRecouped(pod.Name, true) - if phase == corev1.PodSucceeded { - anyPodSuccess = true - } woc.updated = true } } @@ -548,7 +544,7 @@ func (woc *wfOperationCtx) processArtifactGCCompletion(ctx context.Context) erro removeFinalizer = woc.wf.Status.ArtifactGCStatus.AllArtifactGCPodsRecouped() } else { // check if all artifacts have been deleted and if so remove Finalizer - removeFinalizer = anyPodSuccess && woc.allArtifactsDeleted() + removeFinalizer = woc.allArtifactsDeleted() } if removeFinalizer { woc.log.Infof("no remaining artifacts to GC, removing artifact GC finalizer (forceFinalizerRemoval=%v)", forceFinalizerRemoval)