Skip to content

Commit

Permalink
Merge pull request #12 from silentred/main
Browse files Browse the repository at this point in the history
bugfix: localstoage plugin
  • Loading branch information
silentred authored Jan 24, 2024
2 parents 2e46d66 + 993e6e9 commit 427c2e9
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 427c2e9

Please sign in to comment.