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

Commit 642fe69

Browse files
committed
bug fix in MinAvailable usage: 0 should be interpreted as 1
1 parent 93e3422 commit 642fe69

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/controller/resource_manager.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,12 @@ func (r *AppWrapperReconciler) isSuccessful(ctx context.Context, appWrapper *mca
178178
}
179179
}
180180
}
181-
// To succeed we need to pass the custom completionstatus check or have enough successful pods if MinAvailable > 0
182-
return custom || appWrapper.Spec.Scheduling.MinAvailable > 0 && counts.Succeeded >= int(appWrapper.Spec.Scheduling.MinAvailable), nil
181+
// To succeed we need to pass the custom completionstatus check or have enough successful pods if MinAvailable >= 0
182+
targetSucceeded := int32(1)
183+
if appWrapper.Spec.Scheduling.MinAvailable > targetSucceeded {
184+
targetSucceeded = appWrapper.Spec.Scheduling.MinAvailable
185+
}
186+
return custom || appWrapper.Spec.Scheduling.MinAvailable >= 0 && counts.Succeeded >= int(targetSucceeded), nil
183187
}
184188

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

0 commit comments

Comments
 (0)