diff --git a/cmd/controller/antplugins/localstorage.go b/cmd/controller/antplugins/localstorage.go index cf3ba19..ee544b1 100644 --- a/cmd/controller/antplugins/localstorage.go +++ b/cmd/controller/antplugins/localstorage.go @@ -111,7 +111,8 @@ func (r *ReportLocalStoragePlugin) Reconcile(ctx *plugin.Context) (result plugin snode, err = stateObj.GetNodeByNodeID(pool.Name) if err != nil { log.Error(err, "find node failed") - return plugin.Result{Error: err} + // local line calculation should not block the reconciling + return plugin.Result{} } localBS = CalculateLocalStorageCapacity(snode) diff --git a/pkg/controller/manager/scheduler/filter/basic.go b/pkg/controller/manager/scheduler/filter/basic.go index f9cad92..1efe1cb 100644 --- a/pkg/controller/manager/scheduler/filter/basic.go +++ b/pkg/controller/manager/scheduler/filter/basic.go @@ -23,6 +23,7 @@ func BasicFilterFunc(ctx *FilterContext, n *state.Node, vol *v1.AntstorVolume) b // if voume matches reservation, then do not do following checks if pass, hasErr := matchReservationFilter(ctx, n, vol); hasErr || pass { + klog.Infof("Reservation pass %t, vol=%s Pool %s", pass, vol.Name, n.Pool.Name) return pass } @@ -120,6 +121,10 @@ func matchReservationFilter(ctx *FilterContext, n *state.Node, vol *v1.AntstorVo return false, true } return true, false + } else { + // volume has reservation id, but no such reservation in node + ctx.Error.AddReason(ReasonReserveNotMatch) + return false, true } } diff --git a/pkg/controller/manager/scheduler/filter/error.go b/pkg/controller/manager/scheduler/filter/error.go index 3954036..c49b7a1 100644 --- a/pkg/controller/manager/scheduler/filter/error.go +++ b/pkg/controller/manager/scheduler/filter/error.go @@ -17,6 +17,7 @@ const ( ReasonPoolAffinity = "PoolAffinity" ReasonPoolUnschedulable = "PoolUnschedulable" ReasonReservationSize = "ReservationTooSmall" + ReasonReserveNotMatch = "ReservationNotMatch" NoStoragePoolAvailable = "NoStoragePoolAvailable" //