apf: add validation to exempt for borrowing
Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com> Kubernetes-commit: f8e4e8abac8637f6510838d7d476a838ce612659
This commit is contained in:
parent
643497556b
commit
dfc035926b
|
|
@ -89,6 +89,10 @@ var (
|
|||
flowcontrol.PriorityLevelConfigurationNameExempt,
|
||||
flowcontrol.PriorityLevelConfigurationSpec{
|
||||
Type: flowcontrol.PriorityLevelEnablementExempt,
|
||||
Exempt: &flowcontrol.ExemptPriorityLevelConfiguration{
|
||||
NominalConcurrencyShares: pointer.Int32(0),
|
||||
LendablePercent: pointer.Int32(0),
|
||||
},
|
||||
},
|
||||
)
|
||||
MandatoryPriorityLevelConfigurationCatchAll = newPriorityLevelConfiguration(
|
||||
|
|
|
|||
|
|
@ -114,4 +114,11 @@ func TestBootstrapPriorityLevelConfigurationWithBorrowing(t *testing.T) {
|
|||
t.Errorf("bootstrap PriorityLevelConfiguration objects not accounted by this test: %v", names)
|
||||
}
|
||||
}
|
||||
exemptPL := MandatoryPriorityLevelConfigurationExempt
|
||||
if exemptPL.Spec.Exempt.NominalConcurrencyShares != nil && *exemptPL.Spec.Exempt.NominalConcurrencyShares != 0 {
|
||||
t.Errorf("Expected exempt priority level to have NominalConcurrencyShares==0 but got %d instead", *exemptPL.Spec.Exempt.NominalConcurrencyShares)
|
||||
}
|
||||
if exemptPL.Spec.Exempt.LendablePercent != nil && *exemptPL.Spec.Exempt.LendablePercent != 0 {
|
||||
t.Errorf("Expected exempt priority level to have LendablePercent==0 but got %d instead", *exemptPL.Spec.Exempt.LendablePercent)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue