Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion pkg/apis/frameworkcontroller/v1/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ func (ts *TaskStatus) IsRunning() bool {
return ts.State == TaskAttemptRunning
}

func (f *Framework) IsCompleting() bool {
return f.Status.State == FrameworkAttemptDeletionPending ||
f.Status.State == FrameworkAttemptDeletionRequested ||
f.Status.State == FrameworkAttemptDeleting
}

func (ts *TaskStatus) IsCompleting() bool {
return ts.State == TaskAttemptDeletionPending ||
ts.State == TaskAttemptDeletionRequested ||
ts.State == TaskAttemptDeleting
}

func (ct CompletionType) IsSucceeded() bool {
return ct.Name == CompletionTypeNameSucceeded
}
Expand Down Expand Up @@ -507,7 +519,8 @@ func (rp RetryPolicySpec) ShouldRetry(

// 0. Built-in Always-on RetryPolicy
if cs.Code == CompletionCodePodSpecInvalid ||
cs.Code == CompletionCodeStopFrameworkRequested {
cs.Code == CompletionCodeStopFrameworkRequested ||
cs.Code == CompletionCodeFrameworkAttemptCompletion {
return RetryDecision{false, true, 0, cs.Diagnostics}
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/frameworkcontroller/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ const (
// complete a single Task in the TaskRole.
//
// Usage:
// If the Pod Spec is invalid or the ExecutionType is ExecutionStop,
// If the Pod Spec is invalid or
// the ExecutionType is ExecutionStop or
// the Task's FrameworkAttempt is completing,
// will not retry.
//
// If the FancyRetryPolicy is enabled,
Expand Down Expand Up @@ -506,7 +508,6 @@ const (
// must have been creation requested successfully and is expected to exist.
// [AssociatedState]
// -> TaskAttemptPreparing
// -> TaskAttemptRunning
// -> TaskAttemptDeleting
// -> TaskAttemptCompleted
TaskAttemptCreationRequested TaskState = "AttemptCreationRequested"
Expand Down
Loading