apiserver: fix lint issue, defaulting and validation test for flowcontrol v1

This commit is contained in:
Abu Kashem
2023-10-11 14:03:42 -04:00
parent 90c091deda
commit 430c226709
5 changed files with 13 additions and 10 deletions

View File

@@ -24,7 +24,7 @@ import (
flowcontrolv1 "k8s.io/api/flowcontrol/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)
func TestDefaultWithPriorityLevelConfiguration(t *testing.T) {
@@ -45,8 +45,8 @@ func TestDefaultWithPriorityLevelConfiguration(t *testing.T) {
Spec: flowcontrolv1.PriorityLevelConfigurationSpec{
Type: flowcontrolv1.PriorityLevelEnablementExempt,
Exempt: &flowcontrolv1.ExemptPriorityLevelConfiguration{
NominalConcurrencyShares: pointer.Int32(0),
LendablePercent: pointer.Int32(0),
NominalConcurrencyShares: ptr.To(int32(0)),
LendablePercent: ptr.To(int32(0)),
},
},
},
@@ -69,7 +69,7 @@ func TestDefaultWithPriorityLevelConfiguration(t *testing.T) {
Type: flowcontrolv1.PriorityLevelEnablementLimited,
Limited: &flowcontrolv1.LimitedPriorityLevelConfiguration{
NominalConcurrencyShares: 5,
LendablePercent: pointer.Int32(0),
LendablePercent: ptr.To(int32(0)),
LimitResponse: flowcontrolv1.LimitResponse{
Type: flowcontrolv1.LimitResponseTypeReject,
},