@@ -17,6 +17,7 @@ import (
17
17
workflowpkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/workflow"
18
18
"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
19
19
workflowv1 "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned/typed/workflow/v1alpha1"
20
+ workflowutil "github.com/argoproj/argo-workflows/workflow/util"
20
21
"github.com/golang/protobuf/ptypes"
21
22
"github.com/golang/protobuf/ptypes/duration"
22
23
"github.com/golang/protobuf/ptypes/empty"
@@ -523,7 +524,7 @@ func (s *clusterImpl) Delete(ctx context.Context, req *v1.ResourceByID) (*empty.
523
524
return nil , err
524
525
}
525
526
526
- if workflow . Spec . Suspend != nil && * workflow . Spec . Suspend {
527
+ if workflowutil . IsWorkflowSuspended ( workflow ) {
527
528
// Resume the workflow so that it may move to the destroy phase without
528
529
// waiting for cleanupExpiredClusters() to kick in.
529
530
log .Infow ("resuming argo workflow" , "workflow-name" , workflow .GetName ())
@@ -662,7 +663,7 @@ func (s *clusterImpl) cleanupExpiredClusters() {
662
663
continue
663
664
}
664
665
665
- if workflow . Spec . Suspend != nil && * workflow . Spec . Suspend {
666
+ if workflowutil . IsWorkflowSuspended ( workflow ) {
666
667
log .Infow ("resuming an argo workflow that has expired" , "workflow-name" , workflow .GetName ())
667
668
_ , err = s .argoWorkflowsClient .ResumeWorkflow (s .argoClientCtx , & workflowpkg.WorkflowResumeRequest {
668
669
Name : workflow .GetName (),
0 commit comments