Skip to content

Commit f1debcd

Browse files
committed
use argo util to check suspend
1 parent ae9bd9f commit f1debcd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

service/cluster/cluster.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
workflowpkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/workflow"
1818
"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
1919
workflowv1 "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned/typed/workflow/v1alpha1"
20+
workflowutil "github.com/argoproj/argo-workflows/workflow/util"
2021
"github.com/golang/protobuf/ptypes"
2122
"github.com/golang/protobuf/ptypes/duration"
2223
"github.com/golang/protobuf/ptypes/empty"
@@ -523,7 +524,7 @@ func (s *clusterImpl) Delete(ctx context.Context, req *v1.ResourceByID) (*empty.
523524
return nil, err
524525
}
525526

526-
if workflow.Spec.Suspend != nil && *workflow.Spec.Suspend {
527+
if workflowutil.IsWorkflowSuspended(workflow) {
527528
// Resume the workflow so that it may move to the destroy phase without
528529
// waiting for cleanupExpiredClusters() to kick in.
529530
log.Infow("resuming argo workflow", "workflow-name", workflow.GetName())
@@ -662,7 +663,7 @@ func (s *clusterImpl) cleanupExpiredClusters() {
662663
continue
663664
}
664665

665-
if workflow.Spec.Suspend != nil && *workflow.Spec.Suspend {
666+
if workflowutil.IsWorkflowSuspended(workflow) {
666667
log.Infow("resuming an argo workflow that has expired", "workflow-name", workflow.GetName())
667668
_, err = s.argoWorkflowsClient.ResumeWorkflow(s.argoClientCtx, &workflowpkg.WorkflowResumeRequest{
668669
Name: workflow.GetName(),

0 commit comments

Comments
 (0)