scheduler: run Unreserve if Reserve fails
If a reserve plugin's Reserve method returns an error, there could be previously allocated resources from successfully completed reserve plugins that must be unallocated by the corresponding Unreserve operation. Since Unreserve operations are idempotent, this patch runs the Unreserve operation of ALL reserve plugins when a Reserve operation fails.
This commit is contained in:
@@ -788,7 +788,8 @@ func (f *frameworkImpl) runPostBindPlugin(ctx context.Context, pl framework.Post
|
||||
// RunReservePluginsReserve runs the Reserve method in the set of configured
|
||||
// reserve plugins. If any of these plugins returns an error, it does not
|
||||
// continue running the remaining ones and returns the error. In such a case,
|
||||
// the pod will not be scheduled.
|
||||
// the pod will not be scheduled and the caller will be expected to call
|
||||
// RunReservePluginsUnreserve.
|
||||
func (f *frameworkImpl) RunReservePluginsReserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (status *framework.Status) {
|
||||
startTime := time.Now()
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user