Skip to content

Commit

Permalink
Adding check for empty tier name
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Hanel <mh@synadia.com>
  • Loading branch information
matthiashanel committed Mar 22, 2022
1 parent afab08b commit a1fd29b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions v2/account_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ func (o *OperatorLimits) IsUnlimited() bool {
// Validate checks that the operator limits contain valid values
func (o *OperatorLimits) Validate(vr *ValidationResults) {
// negative values mean unlimited, so all numbers are valid
if len(o.JetStreamTieredLimits) > 0 && (o.JetStreamLimits != JetStreamLimits{}) {
vr.AddError("JetStream Limits and tiered JetStream Limits are mutually exclusive")
if len(o.JetStreamTieredLimits) > 0 {
if (o.JetStreamLimits != JetStreamLimits{}) {
vr.AddError("JetStream Limits and tiered JetStream Limits are mutually exclusive")
}
if _, ok := o.JetStreamTieredLimits[""]; ok {
vr.AddError(`Tiered JetStream Limits can nont contain a blank "" tier name`)
}
}
}

Expand Down

0 comments on commit a1fd29b

Please sign in to comment.