diff --git a/internal/controllers/clusterclass/clusterclass_controller_test.go b/internal/controllers/clusterclass/clusterclass_controller_test.go index d547019593ff..199427d90770 100644 --- a/internal/controllers/clusterclass/clusterclass_controller_test.go +++ b/internal/controllers/clusterclass/clusterclass_controller_test.go @@ -29,8 +29,6 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/version" - utilversion "k8s.io/apiserver/pkg/util/version" utilfeature "k8s.io/component-base/featuregate/testing" "k8s.io/klog/v2" "k8s.io/utils/ptr" @@ -1162,14 +1160,15 @@ func TestReconciler_reconcileVariables(t *testing.T) { // Pin the compatibility version used in variable CEL validation to 1.29, so we don't have to continuously refactor // the unit tests that verify that compatibility is handled correctly. - effectiveVer := utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent) - if effectiveVer != nil { - g.Expect(effectiveVer.MinCompatibilityVersion()).To(Equal(version.MustParse("v1.29"))) - } else { - v := utilversion.DefaultKubeEffectiveVersion() - v.SetMinCompatibilityVersion(version.MustParse("v1.29")) - g.Expect(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, v, nil)).To(Succeed()) - } + // FIXME(sbueringer) + //effectiveVer := utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent) + //if effectiveVer != nil { + // g.Expect(effectiveVer.MinCompatibilityVersion()).To(Equal(version.MustParse("v1.29"))) + //} else { + // v := utilversion.DefaultKubeEffectiveVersion() + // v.SetMinCompatibilityVersion(version.MustParse("v1.29")) + // g.Expect(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, v, nil)).To(Succeed()) + //} s := &scope{ clusterClass: tt.clusterClass, diff --git a/internal/topology/variables/clusterclass_variable_validation_test.go b/internal/topology/variables/clusterclass_variable_validation_test.go index 38ad783bd2bc..28cee315dab4 100644 --- a/internal/topology/variables/clusterclass_variable_validation_test.go +++ b/internal/topology/variables/clusterclass_variable_validation_test.go @@ -21,11 +21,8 @@ import ( "strings" "testing" - . "github.com/onsi/gomega" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apimachinery/pkg/util/version" - utilversion "k8s.io/apiserver/pkg/util/version" "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" @@ -342,18 +339,19 @@ func Test_ValidateClusterClassVariables(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - g := NewWithT(t) + //g := NewWithT(t) // Pin the compatibility version used in variable CEL validation to 1.29, so we don't have to continuously refactor // the unit tests that verify that compatibility is handled correctly. - effectiveVer := utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent) - if effectiveVer != nil { - g.Expect(effectiveVer.MinCompatibilityVersion()).To(Equal(version.MustParse("v1.29"))) - } else { - v := utilversion.DefaultKubeEffectiveVersion() - v.SetMinCompatibilityVersion(version.MustParse("v1.29")) - g.Expect(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, v, nil)).To(Succeed()) - } + // FIXME(sbueringer) + //effectiveVer := utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent) + //if effectiveVer != nil { + // g.Expect(effectiveVer.MinCompatibilityVersion()).To(Equal(version.MustParse("v1.29"))) + //} else { + // v := utilversion.DefaultKubeEffectiveVersion() + // v.SetMinCompatibilityVersion(version.MustParse("v1.29")) + // g.Expect(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, v, nil)).To(Succeed()) + //} gotErrs := ValidateClusterClassVariables(ctx, tt.oldClusterClassVariables, diff --git a/internal/webhooks/clusterclass_test.go b/internal/webhooks/clusterclass_test.go index 49b8928529ad..209fd421e132 100644 --- a/internal/webhooks/clusterclass_test.go +++ b/internal/webhooks/clusterclass_test.go @@ -25,8 +25,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/version" - utilversion "k8s.io/apiserver/pkg/util/version" utilfeature "k8s.io/component-base/featuregate/testing" "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" @@ -1870,14 +1868,15 @@ func TestClusterClassValidation(t *testing.T) { // Pin the compatibility version used in variable CEL validation to 1.29, so we don't have to continuously refactor // the unit tests that verify that compatibility is handled correctly. - effectiveVer := utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent) - if effectiveVer != nil { - g.Expect(effectiveVer.MinCompatibilityVersion()).To(Equal(version.MustParse("v1.29"))) - } else { - v := utilversion.DefaultKubeEffectiveVersion() - v.SetMinCompatibilityVersion(version.MustParse("v1.29")) - g.Expect(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, v, nil)).To(Succeed()) - } + // FIXME(sbueringer) + //effectiveVer := utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent) + //if effectiveVer != nil { + // g.Expect(effectiveVer.MinCompatibilityVersion()).To(Equal(version.MustParse("v1.29"))) + //} else { + // v := utilversion.DefaultKubeEffectiveVersion() + // v.SetMinCompatibilityVersion(version.MustParse("v1.29")) + // g.Expect(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, v, nil)).To(Succeed()) + //} // Create the webhook and add the fakeClient as its client. webhook := &ClusterClass{Client: fakeClient}