Skip to content

Commit ffa9791

Browse files
Merge pull request #8683 from bryan-cox/k8s-bump
CNTRLPLANE-3599: Remove controller-runtime v0.19.7 pin for k8s 1.36 bump
2 parents f13c62d + 0132ec7 commit ffa9791

107 files changed

Lines changed: 4127 additions & 1272 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

control-plane-operator/controllers/azureprivatelinkservice/controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func (r *AzurePrivateLinkServiceReconciler) Reconcile(ctx context.Context, req c
269269
controllerutil.AddFinalizer(azPLS, azurePrivateLinkServiceFinalizer)
270270
if err := r.Update(ctx, azPLS); err != nil {
271271
if apierrors.IsConflict(err) {
272-
return ctrl.Result{Requeue: true}, nil
272+
return ctrl.Result{RequeueAfter: time.Second}, nil
273273
}
274274
return ctrl.Result{}, err
275275
}
@@ -368,7 +368,7 @@ func (r *AzurePrivateLinkServiceReconciler) ensureHCPFinalizer(ctx context.Conte
368368
controllerutil.AddFinalizer(hcp, hcpAzurePLSFinalizerName)
369369
if err := r.Patch(ctx, hcp, client.MergeFromWithOptions(originalHCP, client.MergeFromWithOptimisticLock{})); err != nil {
370370
if apierrors.IsConflict(err) {
371-
return ctrl.Result{Requeue: true}, nil
371+
return ctrl.Result{RequeueAfter: time.Second}, nil
372372
}
373373
return ctrl.Result{}, fmt.Errorf("failed to add HCP finalizer: %w", err)
374374
}
@@ -400,7 +400,7 @@ func (r *AzurePrivateLinkServiceReconciler) reconcileHCPDeletion(ctx context.Con
400400
controllerutil.RemoveFinalizer(hcp, hcpAzurePLSFinalizerName)
401401
if err := r.Patch(ctx, hcp, client.MergeFromWithOptions(originalHCP, client.MergeFromWithOptimisticLock{})); err != nil {
402402
if apierrors.IsConflict(err) {
403-
return ctrl.Result{Requeue: true}, nil
403+
return ctrl.Result{RequeueAfter: time.Second}, nil
404404
}
405405
return ctrl.Result{}, fmt.Errorf("failed to remove HCP finalizer: %w", err)
406406
}

control-plane-operator/controllers/azureprivatelinkservice/controller_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"net/http"
77
"testing"
8+
"time"
89

910
. "github.com/onsi/gomega"
1011

@@ -3426,7 +3427,7 @@ func TestReconcile_WhenFinalizerAddConflicts_ItShouldRequeue(t *testing.T) {
34263427
})
34273428

34283429
g.Expect(err).ToNot(HaveOccurred())
3429-
g.Expect(result.Requeue).To(BeTrue(), "should requeue on conflict")
3430+
g.Expect(result.RequeueAfter).To(Equal(time.Second), "should requeue on conflict")
34303431
}
34313432

34323433
func TestEnsureHCPFinalizer_WhenPatchConflicts_ItShouldRequeue(t *testing.T) {
@@ -3457,7 +3458,7 @@ func TestEnsureHCPFinalizer_WhenPatchConflicts_ItShouldRequeue(t *testing.T) {
34573458

34583459
result, err := r.ensureHCPFinalizer(t.Context(), hcp, testr.New(t))
34593460
g.Expect(err).ToNot(HaveOccurred())
3460-
g.Expect(result.Requeue).To(BeTrue(), "should requeue on conflict")
3461+
g.Expect(result.RequeueAfter).To(Equal(time.Second), "should requeue on conflict")
34613462
}
34623463

34633464
func TestReconcileHCPDeletion_WhenPatchConflicts_ItShouldRequeue(t *testing.T) {
@@ -3499,7 +3500,7 @@ func TestReconcileHCPDeletion_WhenPatchConflicts_ItShouldRequeue(t *testing.T) {
34993500

35003501
result, err := r.reconcileHCPDeletion(t.Context(), azPLS, hcp, testr.New(t))
35013502
g.Expect(err).ToNot(HaveOccurred())
3502-
g.Expect(result.Requeue).To(BeTrue(), "should requeue on conflict")
3503+
g.Expect(result.RequeueAfter).To(Equal(time.Second), "should requeue on conflict")
35033504
}
35043505

35053506
func TestUpdatePrivateEndpointStatus_WhenStatusPatchFails_ItShouldReturnError(t *testing.T) {

control-plane-operator/controllers/azureprivatelinkservice/observer_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func TestReconcile(t *testing.T) {
138138
hcp *hyperv1.HostedControlPlane
139139
existingPLS *hyperv1.AzurePrivateLinkService
140140
expectError bool
141+
expectRequeueAfter time.Duration
141142
expectPLSCreated bool
142143
expectedLoadBalancerIP string
143144
}{
@@ -173,9 +174,10 @@ func TestReconcile(t *testing.T) {
173174
svc.Status.LoadBalancer.Ingress = []corev1.LoadBalancerIngress{}
174175
return svc
175176
}(),
176-
hcp: defaultHCP(),
177-
expectError: false,
178-
expectPLSCreated: false,
177+
hcp: defaultHCP(),
178+
expectError: false,
179+
expectRequeueAfter: 30 * time.Second,
180+
expectPLSCreated: false,
179181
},
180182
{
181183
name: "When HCP is being deleted, it should not create CR",
@@ -318,7 +320,7 @@ func TestReconcile(t *testing.T) {
318320
g.Expect(err).ToNot(HaveOccurred())
319321
}
320322

321-
g.Expect(result.Requeue).To(BeFalse())
323+
g.Expect(result.RequeueAfter).To(Equal(tt.expectRequeueAfter))
322324

323325
// Check if AzurePrivateLinkService CR was created/updated
324326
if tt.expectPLSCreated {

control-plane-operator/controllers/gcpprivateserviceconnect/observer_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package gcpprivateserviceconnect
33
import (
44
"context"
55
"testing"
6+
"time"
67

78
. "github.com/onsi/gomega"
89

@@ -103,7 +104,7 @@ func TestReconcileIntegration(t *testing.T) {
103104
requestName string
104105
service *corev1.Service
105106
hcp *hyperv1.HostedControlPlane
106-
expectRequeue bool
107+
expectRequeueAfter time.Duration
107108
expectError bool
108109
expectGCPPSCCreated bool
109110
}{
@@ -148,7 +149,7 @@ func TestReconcileIntegration(t *testing.T) {
148149
},
149150
},
150151
},
151-
expectRequeue: false,
152+
expectRequeueAfter: 0,
152153
expectError: false,
153154
expectGCPPSCCreated: true,
154155
},
@@ -172,7 +173,7 @@ func TestReconcileIntegration(t *testing.T) {
172173
},
173174
},
174175
},
175-
expectRequeue: false,
176+
expectRequeueAfter: 0,
176177
expectError: false,
177178
expectGCPPSCCreated: false,
178179
},
@@ -194,7 +195,7 @@ func TestReconcileIntegration(t *testing.T) {
194195
},
195196
},
196197
},
197-
expectRequeue: false,
198+
expectRequeueAfter: 0,
198199
expectError: false,
199200
expectGCPPSCCreated: false,
200201
},
@@ -218,7 +219,7 @@ func TestReconcileIntegration(t *testing.T) {
218219
},
219220
},
220221
},
221-
expectRequeue: false,
222+
expectRequeueAfter: 0,
222223
expectError: false,
223224
expectGCPPSCCreated: false,
224225
},
@@ -273,7 +274,7 @@ func TestReconcileIntegration(t *testing.T) {
273274
g.Expect(err).ToNot(HaveOccurred())
274275
}
275276

276-
g.Expect(result.Requeue).To(Equal(tt.expectRequeue))
277+
g.Expect(result.RequeueAfter).To(Equal(tt.expectRequeueAfter))
277278

278279
// Check if GCPPrivateServiceConnect CR was created
279280
if tt.expectGCPPSCCreated {

control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,16 +1136,30 @@ func TestReconcileOAuthService(t *testing.T) {
11361136
if err := fakeClient.List(ctx, &actualServices); err != nil {
11371137
t.Fatalf("failed to list services: %v", err)
11381138
}
1139+
if actualServices.Items == nil {
1140+
actualServices.Items = []corev1.Service{}
1141+
}
11391142

1140-
if diff := testutil.MarshalYamlAndDiff(&actualServices, &corev1.ServiceList{Items: tc.expectedServices}, t); diff != "" {
1143+
expectedServices := tc.expectedServices
1144+
if expectedServices == nil {
1145+
expectedServices = []corev1.Service{}
1146+
}
1147+
if diff := testutil.MarshalYamlAndDiff(&actualServices, &corev1.ServiceList{Items: expectedServices}, t); diff != "" {
11411148
t.Errorf("actual services differ from expected: %s", diff)
11421149
}
11431150

11441151
var actualRoutes routev1.RouteList
11451152
if err := fakeClient.List(ctx, &actualRoutes); err != nil {
11461153
t.Fatalf("failed to list routes: %v", err)
11471154
}
1148-
if diff := testutil.MarshalYamlAndDiff(&actualRoutes, &routev1.RouteList{Items: tc.expectedRoutes}, t); diff != "" {
1155+
if actualRoutes.Items == nil {
1156+
actualRoutes.Items = []routev1.Route{}
1157+
}
1158+
expectedRoutes := tc.expectedRoutes
1159+
if expectedRoutes == nil {
1160+
expectedRoutes = []routev1.Route{}
1161+
}
1162+
if diff := testutil.MarshalYamlAndDiff(&actualRoutes, &routev1.RouteList{Items: expectedRoutes}, t); diff != "" {
11491163
t.Errorf("actual routes differ from expected: %s", diff)
11501164
}
11511165
})
@@ -1451,16 +1465,30 @@ func TestReconcileAPIServerService(t *testing.T) {
14511465
if err := fakeClient.List(ctx, &actualServices); err != nil {
14521466
t.Fatalf("failed to list services: %v", err)
14531467
}
1468+
if actualServices.Items == nil {
1469+
actualServices.Items = []corev1.Service{}
1470+
}
14541471

1455-
if diff := testutil.MarshalYamlAndDiff(&actualServices, &corev1.ServiceList{Items: tc.expectedServices}, t); diff != "" {
1472+
expectedServices := tc.expectedServices
1473+
if expectedServices == nil {
1474+
expectedServices = []corev1.Service{}
1475+
}
1476+
if diff := testutil.MarshalYamlAndDiff(&actualServices, &corev1.ServiceList{Items: expectedServices}, t); diff != "" {
14561477
t.Errorf("actual services differ from expected: %s", diff)
14571478
}
14581479

14591480
var actualRoutes routev1.RouteList
14601481
if err := fakeClient.List(ctx, &actualRoutes); err != nil {
14611482
t.Fatalf("failed to list routes: %v", err)
14621483
}
1463-
if diff := testutil.MarshalYamlAndDiff(&actualRoutes, &routev1.RouteList{Items: tc.expectedRoutes}, t); diff != "" {
1484+
if actualRoutes.Items == nil {
1485+
actualRoutes.Items = []routev1.Route{}
1486+
}
1487+
expectedRoutes := tc.expectedRoutes
1488+
if expectedRoutes == nil {
1489+
expectedRoutes = []routev1.Route{}
1490+
}
1491+
if diff := testutil.MarshalYamlAndDiff(&actualRoutes, &routev1.RouteList{Items: expectedRoutes}, t); diff != "" {
14641492
t.Errorf("actual routes differ from expected: %s", diff)
14651493
}
14661494
})
@@ -1671,7 +1699,14 @@ func TestReconcileHCPRouterServices(t *testing.T) {
16711699
if err := c.List(ctx, &services); err != nil {
16721700
t.Fatalf("failed to list services: %v", err)
16731701
}
1674-
if diff := testutil.MarshalYamlAndDiff(&services, &corev1.ServiceList{Items: tc.expectedServices}, t); diff != "" {
1702+
expectedServices := tc.expectedServices
1703+
if expectedServices == nil {
1704+
expectedServices = []corev1.Service{}
1705+
}
1706+
if services.Items == nil {
1707+
services.Items = []corev1.Service{}
1708+
}
1709+
if diff := testutil.MarshalYamlAndDiff(&services, &corev1.ServiceList{Items: expectedServices}, t); diff != "" {
16751710
t.Errorf("actual services differ from expected: %s", diff)
16761711
}
16771712
})

go.mod

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ require (
6666
github.com/openshift/cloud-credential-operator v0.0.0-20250225003505-216fd1a30ec3
6767
github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1
6868
github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20241204142113-43631b045675
69-
github.com/openshift/cluster-node-tuning-operator v0.0.0-20250225115807-f166846b7256
69+
github.com/openshift/cluster-node-tuning-operator v0.0.0-20260527203700-73801cc280b3
7070
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87
71-
github.com/openshift/hypershift/api v0.0.0-20240604072534-cd2d5291e2b7
71+
github.com/openshift/hypershift/api v0.0.0-20250724113115-0281b49cc465
7272
github.com/openshift/library-go v0.0.0-20251204132909-8814e976a023
7373
github.com/openshift/multi-operator-manager v0.0.0-20260112172834-b64ebc8c627b
7474
github.com/operator-framework/api v0.37.0
@@ -301,7 +301,7 @@ require (
301301
k8s.io/csi-translation-lib v0.35.0 // indirect
302302
k8s.io/kms v0.35.1 // indirect
303303
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect
304-
k8s.io/kubelet v0.32.2 // indirect
304+
k8s.io/kubelet v0.33.3 // indirect
305305
kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 // indirect
306306
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 // indirect
307307
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
@@ -319,9 +319,6 @@ replace github.com/k-orc/openstack-resource-controller => sigs.k8s.io/cluster-ap
319319
// CVE-2025-30204
320320
replace github.com/golang-jwt/jwt/v4 => github.com/golang-jwt/jwt/v4 v4.5.2
321321

322-
// webhook.Validator deprecation in v0.20 breaks everything, conversion is nontrivial
323-
replace sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.19.7
324-
325322
// Use our openshift version of karpenter instead of upstream
326323
replace github.com/aws/karpenter-provider-aws => github.com/openshift/aws-karpenter-provider-aws v0.0.0-20260311064431-f0be9c72e5bf
327324

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e63
615615
github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1/go.mod h1:/hEmyZ903PeqntDSxLgZcje96/2lC3PmvsnUABQpR8Q=
616616
github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20241204142113-43631b045675 h1:hPFyXtaR42wqKKGMVP4G7M2vmp5iBxBqKetMguh4Td0=
617617
github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20241204142113-43631b045675/go.mod h1:0tGCwMCgKq7KhJWDGr6Tsqqb6Sk3epz/b6tfFDFK1Ug=
618-
github.com/openshift/cluster-node-tuning-operator v0.0.0-20250225115807-f166846b7256 h1:YLqKXRH7DTukM1sxLOi++uUe7R2m0ivK7yqf0X6emok=
619-
github.com/openshift/cluster-node-tuning-operator v0.0.0-20250225115807-f166846b7256/go.mod h1:nMuHN1oKtpWkQlV1jwqMYV0UfF6wWb+e3TazrWTbNSY=
618+
github.com/openshift/cluster-node-tuning-operator v0.0.0-20260527203700-73801cc280b3 h1:oZXGbNRqAqe+mPEvC2GP4fWtkkn5isB6G+PyxpNKaEQ=
619+
github.com/openshift/cluster-node-tuning-operator v0.0.0-20260527203700-73801cc280b3/go.mod h1:8aR3IFSv4aq7edM3U8UDpWHUFP/nKQneNPoiheWRsYU=
620620
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 h1:cHyxR+Y8rAMT6m1jQCaYGRwikqahI0OjjUDhFNf3ySQ=
621621
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA=
622622
github.com/openshift/kubernetes-sigs-karpenter v0.0.0-20260310165629-67e201b559d5 h1:vkWMN8h47VGeqtES4jvRDfWWDqPIGTMtm2ltcg8GcuA=
@@ -1056,8 +1056,8 @@ k8s.io/kube-scheduler v0.35.1 h1:xhF7M/4Hclq69IAG6K6qW2Y2P3jf9btRqccon3hKz9s=
10561056
k8s.io/kube-scheduler v0.35.1/go.mod h1:6wg+wyqGBuT93PRNmk7b/xPvYZ28K4JmUfWgeIz/JAU=
10571057
k8s.io/kubectl v0.35.1 h1:zP3Er8C5i1dcAFUMh9Eva0kVvZHptXIn/+8NtRWMxwg=
10581058
k8s.io/kubectl v0.35.1/go.mod h1:cQ2uAPs5IO/kx8R5s5J3Ihv3VCYwrx0obCXum0CvnXo=
1059-
k8s.io/kubelet v0.32.2 h1:WFTSYdt3BB1aTApDuKNI16x/4MYqqX8WBBBBh3KupDg=
1060-
k8s.io/kubelet v0.32.2/go.mod h1:cC1ms5RS+lu0ckVr6AviCQXHLSPKEBC3D5oaCBdTGkI=
1059+
k8s.io/kubelet v0.33.3 h1:Cvy8+7Lq9saZds2ib7YBXbKvkMMJu3f5mzucmhSIJno=
1060+
k8s.io/kubelet v0.33.3/go.mod h1:Q1Cfr6VQq1m9v9XsE/mDmhTxPdN6NPU6Ug0e6mAqi58=
10611061
k8s.io/pod-security-admission v0.35.1 h1:Ra7QA/mTXVabzzgQAe36trllpQdGSvwuq9pdnXsIqoI=
10621062
k8s.io/pod-security-admission v0.35.1/go.mod h1:J2OnqW+rNItdl6XZeySa4m2nDqrZ+nBpk1Mr6Vf9M/U=
10631063
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
@@ -1088,8 +1088,8 @@ sigs.k8s.io/cluster-api-provider-openstack v0.13.3 h1:qBPgWG1E3wiiK8+VR5a3jnKGTy
10881088
sigs.k8s.io/cluster-api-provider-openstack v0.13.3/go.mod h1:McuqrgmgsbK4yaC1HKqJ7dxKnOERmXQedUUL15sqelQ=
10891089
sigs.k8s.io/cluster-api-provider-openstack/orc v0.0.0-20250113192833-e4f56a2b4f32 h1:AkFSgi+dAnPLtg+SXjtCf3rDzjI/mskDiJ1PWHZoRno=
10901090
sigs.k8s.io/cluster-api-provider-openstack/orc v0.0.0-20250113192833-e4f56a2b4f32/go.mod h1:hQOMZZjzuAt9pdLaE/tj5ByDTVNBkqNaP10ijnqNZfU=
1091-
sigs.k8s.io/controller-runtime v0.19.7 h1:DLABZfMr20A+AwCZOHhcbcu+TqBXnJZaVBri9K3EO48=
1092-
sigs.k8s.io/controller-runtime v0.19.7/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4=
1091+
sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A=
1092+
sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8=
10931093
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs=
10941094
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
10951095
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=

hypershift-operator/controllers/hostedcluster/createorupdate_annotation_enforcer_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ func TestCreateOrUpdateWithAnnotationFactory(t *testing.T) {
4343
return func() error { return nil }
4444
},
4545
expected: &corev1.ConfigMap{
46-
TypeMeta: metav1.TypeMeta{
47-
Kind: "ConfigMap",
48-
APIVersion: "v1",
49-
},
5046
ObjectMeta: metav1.ObjectMeta{
5147
Name: "foo",
5248
Namespace: "bar",
@@ -77,10 +73,6 @@ func TestCreateOrUpdateWithAnnotationFactory(t *testing.T) {
7773
}
7874
},
7975
expected: &corev1.ConfigMap{
80-
TypeMeta: metav1.TypeMeta{
81-
Kind: "ConfigMap",
82-
APIVersion: "v1",
83-
},
8476
ObjectMeta: metav1.ObjectMeta{
8577
Name: "foo",
8678
Namespace: "bar",
@@ -106,10 +98,6 @@ func TestCreateOrUpdateWithAnnotationFactory(t *testing.T) {
10698
return func() error { return nil }
10799
},
108100
expected: &corev1.Namespace{
109-
TypeMeta: metav1.TypeMeta{
110-
Kind: "Namespace",
111-
APIVersion: "v1",
112-
},
113101
ObjectMeta: metav1.ObjectMeta{
114102
Name: "foo",
115103
},

hypershift-operator/controllers/hostedcluster/testdata/capi-provider/zz_fixture_TestReconcileComponents.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hypershift-operator/controllers/hostedcluster/testdata/cluster-api/zz_fixture_TestReconcileComponents.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)