Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

bug fix in MinAvailable usage: 0 should be interpreted as 1 #161

Merged
merged 1 commit into from
May 3, 2024
Merged
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
8 changes: 6 additions & 2 deletions internal/controller/resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,12 @@ func (r *AppWrapperReconciler) isSuccessful(ctx context.Context, appWrapper *mca
}
}
}
// To succeed we need to pass the custom completionstatus check or have enough successful pods if MinAvailable > 0
return custom || appWrapper.Spec.Scheduling.MinAvailable > 0 && counts.Succeeded >= int(appWrapper.Spec.Scheduling.MinAvailable), nil
// To succeed we need to pass the custom completion status check or have enough successful pods if MinAvailable >= 0
targetSucceeded := 1
if appWrapper.Spec.Scheduling.MinAvailable > int32(targetSucceeded) {
targetSucceeded = int(appWrapper.Spec.Scheduling.MinAvailable)
}
return custom || (appWrapper.Spec.Scheduling.MinAvailable >= 0 && counts.Succeeded >= targetSucceeded), nil
}

// Delete wrapped resources, forcing deletion of pods and wrapped resources if enabled
Expand Down