Skip to content

Commit

Permalink
Merge branch 'master-dev' into my-main
Browse files Browse the repository at this point in the history
  • Loading branch information
silentred committed Jan 24, 2024
2 parents acdbfc7 + 7740289 commit 993e6e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/controller/antplugins/localstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 5 additions & 0 deletions pkg/controller/manager/scheduler/filter/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/controller/manager/scheduler/filter/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
ReasonPoolAffinity = "PoolAffinity"
ReasonPoolUnschedulable = "PoolUnschedulable"
ReasonReservationSize = "ReservationTooSmall"
ReasonReserveNotMatch = "ReservationNotMatch"

NoStoragePoolAvailable = "NoStoragePoolAvailable"
//
Expand Down

0 comments on commit 993e6e9

Please sign in to comment.