mirror of
https://github.com/openziti/zrok.git
synced 2024-11-24 17:13:51 +01:00
fix for mixing limited and unlimited resource counts (#680)
This commit is contained in:
parent
5fe2530076
commit
466ae110d2
@ -134,15 +134,15 @@ func (a *Agent) CanCreateShare(acctId, envId int, reserved, uniqueName bool, _ s
|
||||
uniqueNames++
|
||||
}
|
||||
}
|
||||
if total+1 > rc.GetShares() {
|
||||
if rc.GetShares() > store.Unlimited && total+1 > rc.GetShares() {
|
||||
logrus.Debugf("account '#%d', environment '%d' over shares limit '%d'", acctId, envId, a.cfg.Shares)
|
||||
return false, nil
|
||||
}
|
||||
if reserved && reserveds+1 > rc.GetReservedShares() {
|
||||
if reserved && rc.GetReservedShares() > store.Unlimited && reserveds+1 > rc.GetReservedShares() {
|
||||
logrus.Debugf("account '#%d', environment '%d' over reserved shares limit '%d'", acctId, envId, a.cfg.ReservedShares)
|
||||
return false, nil
|
||||
}
|
||||
if reserved && uniqueName && uniqueNames+1 > rc.GetUniqueNames() {
|
||||
if reserved && uniqueName && rc.GetUniqueNames() > store.Unlimited && uniqueNames+1 > rc.GetUniqueNames() {
|
||||
logrus.Debugf("account '#%d', environment '%d' over unique names limit '%d'", acctId, envId, a.cfg.UniqueNames)
|
||||
return false, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user