From 57d188a5ed94b8a6062ce39522e4e55ef8296e61 Mon Sep 17 00:00:00 2001 From: Bruno Andrade Date: Mon, 30 Mar 2026 17:51:22 -0300 Subject: [PATCH] UPSTREAM: : OCPBUGS-81452 rollout stall for webhook installs --- internal/operator-controller/applier/phase.go | 2 +- .../operator-controller/applier/phase_test.go | 39 ++++++++++++++++--- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/internal/operator-controller/applier/phase.go b/internal/operator-controller/applier/phase.go index 7a495ee5a..ee38cfac8 100644 --- a/internal/operator-controller/applier/phase.go +++ b/internal/operator-controller/applier/phase.go @@ -120,10 +120,10 @@ var ( PhaseInfrastructure: { {Kind: "Service"}, {Kind: "Issuer", Group: "cert-manager.io"}, + {Kind: "Certificate", Group: "cert-manager.io"}, }, PhaseDeploy: { - {Kind: "Certificate", Group: "cert-manager.io"}, {Kind: "Deployment", Group: "apps"}, }, diff --git a/internal/operator-controller/applier/phase_test.go b/internal/operator-controller/applier/phase_test.go index 8a4554be0..d50563b27 100644 --- a/internal/operator-controller/applier/phase_test.go +++ b/internal/operator-controller/applier/phase_test.go @@ -165,6 +165,17 @@ func Test_PhaseSort(t *testing.T) { }, }, }, + { + Object: &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "cert-manager.io/v1", + "kind": "Certificate", + "metadata": map[string]interface{}{ + "name": "test", + }, + }, + }, + }, { Object: &unstructured.Unstructured{ Object: map[string]interface{}{ @@ -314,6 +325,17 @@ func Test_PhaseSort(t *testing.T) { }, }, }, + { + Object: &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "cert-manager.io/v1", + "kind": "Certificate", + "metadata": map[string]interface{}{ + "name": "test", + }, + }, + }, + }, }, }, { @@ -454,7 +476,7 @@ func Test_PhaseSort(t *testing.T) { want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{}, }, { - name: "sort by group within same phase", + name: "sort by group across infrastructure and deploy phases", objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { Object: &unstructured.Unstructured{ @@ -481,24 +503,29 @@ func Test_PhaseSort(t *testing.T) { }, want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: ptr.To(string(applier.PhaseDeploy)), + Name: ptr.To(string(applier.PhaseInfrastructure)), Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { Object: &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "apps/v1", - "kind": "Deployment", + "apiVersion": "cert-manager.io/v1", + "kind": "Certificate", "metadata": map[string]interface{}{ "name": "test", }, }, }, }, + }, + }, + { + Name: ptr.To(string(applier.PhaseDeploy)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { Object: &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "cert-manager.io/v1", - "kind": "Certificate", + "apiVersion": "apps/v1", + "kind": "Deployment", "metadata": map[string]interface{}{ "name": "test", },