Change:
} return scheme } <del> errExpectedFn := func(v int32, msg string) field.ErrorList { return field.ErrorList{ field.Invalid(field.NewPath("spec").Child("limited").Child("nominalConcurrencyShares"), int32(v), msg), } } </del> tests := []struct { <del> name               string obj                runtime.Object old                *flowcontrol.PriorityLevelConfiguration // for UPDATE only zeroFeatureEnabled bool scheme             *runtime.Scheme errExpected        field.ErrorList </del> <ins> name        string obj         runtime.Object old         *flowcontrol.PriorityLevelConfiguration // for UPDATE only scheme      *runtime.Scheme errExpected field.ErrorList </ins> }{ { <del> name:               "v1, feature disabled, create, zero value, error expected", obj:                v1ObjFn(ptr.To(int32(0))), zeroFeatureEnabled: false, scheme:             v1SchemeFn(t), errExpected:        errExpectedFn(0, "must be positive"), }, { name:               "v1, feature disabled, create, unset, no error expected", obj:                v1ObjFn(nil), zeroFeatureEnabled: false, scheme:             v1SchemeFn(t), errExpected:        nil, }, { name:               "v1, feature disabled, create, non-zero, no error expected", obj:                v1ObjFn(ptr.To(int32(1))), zeroFeatureEnabled: false, scheme:             v1SchemeFn(t), errExpected:        nil, }, { name:               "v1, feature enabled, create, zero value, no error expected", obj:                v1ObjFn(ptr.To(int32(0))), zeroFeatureEnabled: true, scheme:             v1SchemeFn(t), errExpected:        nil, }, { name:               "v1, feature enabled, create, unset, no error expected", obj:                v1ObjFn(nil), zeroFeatureEnabled: true, scheme:             v1SchemeFn(t), errExpected:        nil, }, { name:               "v1, feature enabled, create, non-zero, no error expected", obj:                v1ObjFn(ptr.To(int32(1))), zeroFeatureEnabled: true, scheme:             v1SchemeFn(t), errExpected:        nil, }, { name:               "v1beta3, feature disabled, create, zero value, error expected", obj:                v1beta3ObjFn(0, true), zeroFeatureEnabled: false, scheme:             v1beta3SchemeFn(t), errExpected:        errExpectedFn(0, "must be positive"), </del> <ins> name:        "v1, create, zero value, no error expected", obj:         v1ObjFn(ptr.To(int32(0))), scheme:      v1SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1beta3, feature disabled, create, zero value without annotation, no error expected", obj:                v1beta3ObjFn(0, false), zeroFeatureEnabled: false, scheme:             v1beta3SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1, create, unset, no error expected", obj:         v1ObjFn(nil), scheme:      v1SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1beta3, feature disabled, create, non-zero, no error expected", obj:                v1beta3ObjFn(1, false), zeroFeatureEnabled: false, scheme:             v1beta3SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1, create, non-zero, no error expected", obj:         v1ObjFn(ptr.To(int32(1))), scheme:      v1SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1beta3, feature enabled, create, zero value, no error expected", obj:                v1beta3ObjFn(0, true), zeroFeatureEnabled: true, scheme:             v1beta3SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1beta3, create, zero value, no error expected", obj:         v1beta3ObjFn(0, true), scheme:      v1beta3SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1beta3, feature enabled, create, zero value without annotation, no error expected", obj:                v1beta3ObjFn(0, false), zeroFeatureEnabled: true, scheme:             v1beta3SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1beta3, create, zero value without annotation, no error expected", obj:         v1beta3ObjFn(0, false), scheme:      v1beta3SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1beta3, feature enabled, create, non-zero, no error expected", obj:                v1beta3ObjFn(1, false), zeroFeatureEnabled: true, scheme:             v1beta3SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1beta3, create, non-zero, no error expected", obj:         v1beta3ObjFn(1, false), scheme:      v1beta3SchemeFn(t), errExpected: nil, </ins> }, // the following use cases cover UPDATE { <del> name:               "v1, feature disabled, update, zero value, existing has non-zero, error expected", obj:                v1ObjFn(ptr.To(int32(0))), old:                internalObjFn(1), zeroFeatureEnabled: false, scheme:             v1SchemeFn(t), errExpected:        errExpectedFn(0, "must be positive"), </del> <ins> name:        "v1, update, zero value, existing has non-zero, no error expected", obj:         v1ObjFn(ptr.To(int32(0))), old:         internalObjFn(1), scheme:      v1SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1, feature disabled, update, zero value, existing has zero, no error expected", obj:                v1ObjFn(ptr.To(int32(0))), old:                internalObjFn(0), zeroFeatureEnabled: false, scheme:             v1SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1, update, zero value, existing has zero, no error expected", obj:         v1ObjFn(ptr.To(int32(0))), old:         internalObjFn(0), scheme:      v1SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1, feature disabled, update, non-zero value, existing has zero, no error expected", obj:                v1ObjFn(ptr.To(int32(1))), old:                internalObjFn(0), zeroFeatureEnabled: false, scheme:             v1SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1, update, non-zero value, existing has zero, no error expected", obj:         v1ObjFn(ptr.To(int32(1))), old:         internalObjFn(0), scheme:      v1SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1, feature enabled, update, zero value, existing has non-zero, no error expected", obj:                v1ObjFn(ptr.To(int32(0))), old:                internalObjFn(1), zeroFeatureEnabled: true, scheme:             v1SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1beta3, update, zero value, existing has non-zero, no error expected", obj:         v1beta3ObjFn(0, true), old:         internalObjFn(1), scheme:      v1beta3SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1, feature enabled, update, zero value, existing has zero, no error expected", obj:                v1ObjFn(ptr.To(int32(0))), old:                internalObjFn(0), zeroFeatureEnabled: true, scheme:             v1SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1beta3, update, zero value, existing has zero, no error expected", obj:         v1beta3ObjFn(0, true), old:         internalObjFn(0), scheme:      v1beta3SchemeFn(t), errExpected: nil, </ins> }, { <del> name:               "v1, feature enabled, update, non-zero value, existing has zero, no error expected", obj:                v1ObjFn(ptr.To(int32(1))), old:                internalObjFn(0), zeroFeatureEnabled: true, scheme:             v1SchemeFn(t), errExpected:        nil, }, { name:               "v1beta3, feature disabled, update, zero value, existing has non-zero, error expected", obj:                v1beta3ObjFn(0, true), old:                internalObjFn(1), zeroFeatureEnabled: false, scheme:             v1beta3SchemeFn(t), errExpected:        errExpectedFn(0, "must be positive"), }, { name:               "v1beta3, feature disabled, update, zero value, existing has zero, no error expected", obj:                v1beta3ObjFn(0, true), old:                internalObjFn(0), zeroFeatureEnabled: false, scheme:             v1beta3SchemeFn(t), errExpected:        nil, }, { name:               "v1beta3, feature disabled, update, non-zero value, existing has zero, no error expected", obj:                v1beta3ObjFn(1, false), old:                internalObjFn(0), zeroFeatureEnabled: false, scheme:             v1beta3SchemeFn(t), errExpected:        nil, }, { name:               "v1beta3, feature enabled, update, zero value, existing has non-zero, no error expected", obj:                v1beta3ObjFn(0, true), old:                internalObjFn(1), zeroFeatureEnabled: true, scheme:             v1beta3SchemeFn(t), errExpected:        nil, }, { name:               "v1beta3, feature enabled, update, zero value, existing has zero, no error expected", obj:                v1beta3ObjFn(0, true), old:                internalObjFn(0), zeroFeatureEnabled: true, scheme:             v1beta3SchemeFn(t), errExpected:        nil, }, { name:               "v1beta3, feature enabled, update, non-zero value, existing has zero, no error expected", obj:                v1beta3ObjFn(1, false), old:                internalObjFn(0), zeroFeatureEnabled: true, scheme:             v1beta3SchemeFn(t), errExpected:        nil, </del> <ins> name:        "v1beta3, update, non-zero value, existing has zero, no error expected", obj:         v1beta3ObjFn(1, false), old:         internalObjFn(0), scheme:      v1beta3SchemeFn(t), errExpected: nil, </ins> }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { <del> defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ZeroLimitedNominalConcurrencyShares, test.zeroFeatureEnabled)() </del> scheme := test.scheme scheme.Default(test.obj)

Discussion:
In 1.30, Priority and Fairness should allow a zero value, either via v1 or v1beta3 (with the roundtrip annotation) in create and update requests See:
/sig api-machinery /cc /assign
The label(s) cannot be applied, because the repository doesn't have them. <detailsIn response to : /triage accpted Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/triage accepted