@@ -25,7 +25,8 @@ import (
2525 apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2626 "k8s.io/apimachinery/pkg/util/validation/field"
2727 "k8s.io/apimachinery/pkg/util/version"
28- utilversion "k8s.io/apiserver/pkg/util/version"
28+ "k8s.io/component-base/featuregate"
29+ utilversion "k8s.io/component-base/version"
2930 "k8s.io/utils/ptr"
3031
3132 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -346,13 +347,13 @@ func Test_ValidateClusterClassVariables(t *testing.T) {
346347
347348 // Pin the compatibility version used in variable CEL validation to 1.29, so we don't have to continuously refactor
348349 // the unit tests that verify that compatibility is handled correctly.
349- effectiveVer := utilversion .DefaultComponentGlobalsRegistry .EffectiveVersionFor (utilversion .DefaultKubeComponent )
350+ effectiveVer := featuregate .DefaultComponentGlobalsRegistry .EffectiveVersionFor (featuregate .DefaultKubeComponent )
350351 if effectiveVer != nil {
351352 g .Expect (effectiveVer .MinCompatibilityVersion ()).To (Equal (version .MustParse ("v1.29" )))
352353 } else {
353354 v := utilversion .DefaultKubeEffectiveVersion ()
354355 v .SetMinCompatibilityVersion (version .MustParse ("v1.29" ))
355- g .Expect (utilversion .DefaultComponentGlobalsRegistry .Register (utilversion .DefaultKubeComponent , v , nil )).To (Succeed ())
356+ g .Expect (featuregate .DefaultComponentGlobalsRegistry .Register (featuregate .DefaultKubeComponent , v , nil )).To (Succeed ())
356357 }
357358
358359 gotErrs := ValidateClusterClassVariables (ctx ,
@@ -1275,7 +1276,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
12751276 },
12761277 },
12771278 wantErrs : []validationMatch {
1278- toolong ("Too long: may not be longer than 6" ,
1279+ toolong ("Too long: may not be more than 6 bytes " ,
12791280 "spec.variables[var].schema.openAPIV3Schema.default" ),
12801281 },
12811282 },
@@ -1295,7 +1296,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
12951296 },
12961297 },
12971298 wantErrs : []validationMatch {
1298- toolong ("Too long: may not be longer than 6" ,
1299+ toolong ("Too long: may not be more than 6 bytes " ,
12991300 "spec.variables[var].schema.openAPIV3Schema.items.default" ),
13001301 },
13011302 },
@@ -1495,7 +1496,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
14951496 },
14961497 },
14971498 wantErrs : []validationMatch {
1498- toolong ("Too long: may not be longer than 6" ,
1499+ toolong ("Too long: may not be more than 6 bytes " ,
14991500 "spec.variables[var].schema.openAPIV3Schema.example" ),
15001501 },
15011502 },
@@ -1636,7 +1637,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
16361637 },
16371638 },
16381639 wantErrs : []validationMatch {
1639- toolong ("may not be longer than 6" ,
1640+ toolong ("may not be more than 6 bytes " ,
16401641 "spec.variables[var].schema.openAPIV3Schema.enum[0]" ),
16411642 },
16421643 },
0 commit comments