@@ -25,7 +25,8 @@ import (
25
25
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
26
26
"k8s.io/apimachinery/pkg/util/validation/field"
27
27
"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"
29
30
"k8s.io/utils/ptr"
30
31
31
32
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -346,13 +347,13 @@ func Test_ValidateClusterClassVariables(t *testing.T) {
346
347
347
348
// Pin the compatibility version used in variable CEL validation to 1.29, so we don't have to continuously refactor
348
349
// the unit tests that verify that compatibility is handled correctly.
349
- effectiveVer := utilversion .DefaultComponentGlobalsRegistry .EffectiveVersionFor (utilversion .DefaultKubeComponent )
350
+ effectiveVer := featuregate .DefaultComponentGlobalsRegistry .EffectiveVersionFor (featuregate .DefaultKubeComponent )
350
351
if effectiveVer != nil {
351
352
g .Expect (effectiveVer .MinCompatibilityVersion ()).To (Equal (version .MustParse ("v1.29" )))
352
353
} else {
353
354
v := utilversion .DefaultKubeEffectiveVersion ()
354
355
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 ())
356
357
}
357
358
358
359
gotErrs := ValidateClusterClassVariables (ctx ,
@@ -1275,7 +1276,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
1275
1276
},
1276
1277
},
1277
1278
wantErrs : []validationMatch {
1278
- toolong ("Too long: may not be longer than 6" ,
1279
+ toolong ("Too long: may not be more than 6 bytes " ,
1279
1280
"spec.variables[var].schema.openAPIV3Schema.default" ),
1280
1281
},
1281
1282
},
@@ -1295,7 +1296,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
1295
1296
},
1296
1297
},
1297
1298
wantErrs : []validationMatch {
1298
- toolong ("Too long: may not be longer than 6" ,
1299
+ toolong ("Too long: may not be more than 6 bytes " ,
1299
1300
"spec.variables[var].schema.openAPIV3Schema.items.default" ),
1300
1301
},
1301
1302
},
@@ -1495,7 +1496,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
1495
1496
},
1496
1497
},
1497
1498
wantErrs : []validationMatch {
1498
- toolong ("Too long: may not be longer than 6" ,
1499
+ toolong ("Too long: may not be more than 6 bytes " ,
1499
1500
"spec.variables[var].schema.openAPIV3Schema.example" ),
1500
1501
},
1501
1502
},
@@ -1636,7 +1637,7 @@ func Test_ValidateClusterClassVariable(t *testing.T) {
1636
1637
},
1637
1638
},
1638
1639
wantErrs : []validationMatch {
1639
- toolong ("may not be longer than 6" ,
1640
+ toolong ("may not be more than 6 bytes " ,
1640
1641
"spec.variables[var].schema.openAPIV3Schema.enum[0]" ),
1641
1642
},
1642
1643
},
0 commit comments