diff --git a/pkg/scheduler/plugins/extender/extender.go b/pkg/scheduler/plugins/extender/extender.go index 21fd1abbe4e..23337a5d261 100644 --- a/pkg/scheduler/plugins/extender/extender.go +++ b/pkg/scheduler/plugins/extender/extender.go @@ -176,6 +176,11 @@ func (ep *extenderPlugin) OnSessionOpen(ssn *framework.Session) { if len(resp.ErrorMessage) == 0 { return nil } + // keep compatibility with old behavior: error messages length is not zero + // but didn't return a code, and code will be 0 for default. Change code to zero for corresponding + if resp.Code == api.Success { + resp.Code = api.Error + } return api.NewFitErrWithStatus(task, node, &api.Status{Code: resp.Code, Reason: resp.ErrorMessage, Plugin: PluginName}) }) }