diff --git a/openshift/patches/002-add-maistra-annotation.patch b/openshift/patches/002-add-maistra-annotation.patch index b4a29b050c..60faae8ba2 100644 --- a/openshift/patches/002-add-maistra-annotation.patch +++ b/openshift/patches/002-add-maistra-annotation.patch @@ -1,7 +1,24 @@ +diff --git a/pkg/reconciler/ingress/ingress_test.go b/pkg/reconciler/ingress/ingress_test.go +index 3a2cb732..acd84867 100644 +--- a/pkg/reconciler/ingress/ingress_test.go ++++ b/pkg/reconciler/ingress/ingress_test.go +@@ -1525,8 +1525,9 @@ type GatewayOpt func(*v1beta1.Gateway) + func gateway(name, namespace string, servers []*istiov1beta1.Server, opts ...GatewayOpt) *v1beta1.Gateway { + gw := &v1beta1.Gateway{ + ObjectMeta: metav1.ObjectMeta{ +- Name: name, +- Namespace: namespace, ++ Name: name, ++ Namespace: namespace, ++ Annotations: map[string]string{resources.MaistraManageRouteAnnotationKey: "false"}, + }, + Spec: istiov1beta1.Gateway{ + Servers: servers, diff --git a/pkg/reconciler/ingress/resources/gateway.go b/pkg/reconciler/ingress/resources/gateway.go ---- a/pkg/reconciler/ingress/resources/gateway.go (revision 2971960b1cf6f44bbf9146e22d0e31eb253d812f) -+++ b/pkg/reconciler/ingress/resources/gateway.go (date 1707288992469) -@@ -41,12 +41,13 @@ +index cd7b320f..06310edf 100644 +--- a/pkg/reconciler/ingress/resources/gateway.go ++++ b/pkg/reconciler/ingress/resources/gateway.go +@@ -42,12 +42,13 @@ import ( ) const ( @@ -21,7 +38,7 @@ diff --git a/pkg/reconciler/ingress/resources/gateway.go b/pkg/reconciler/ingres ) var httpServerPortName = "http-server" -@@ -202,6 +203,9 @@ +@@ -204,6 +205,9 @@ func makeWildcardTLSGateways(originWildcardSecrets map[string]*corev1.Secret, Name: WildcardGatewayName(secret.Name, gatewayService.Namespace, gatewayService.Name), Namespace: secret.Namespace, OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(secret, gvk)}, @@ -31,7 +48,7 @@ diff --git a/pkg/reconciler/ingress/resources/gateway.go b/pkg/reconciler/ingres }, Spec: istiov1beta1.Gateway{ Selector: gatewayService.Spec.Selector, -@@ -257,6 +261,9 @@ +@@ -259,6 +263,9 @@ func makeIngressGateway(ing *v1alpha1.Ingress, visibility v1alpha1.IngressVisibi // We need this label to find out all Gateways of a given Ingress. networking.IngressLabelKey: ing.GetName(), }, @@ -41,25 +58,11 @@ diff --git a/pkg/reconciler/ingress/resources/gateway.go b/pkg/reconciler/ingres }, Spec: istiov1beta1.Gateway{ Selector: selector, -diff --git a/pkg/reconciler/ingress/ingress_test.go b/pkg/reconciler/ingress/ingress_test.go ---- a/pkg/reconciler/ingress/ingress_test.go (revision 2971960b1cf6f44bbf9146e22d0e31eb253d812f) -+++ b/pkg/reconciler/ingress/ingress_test.go (date 1707289100741) -@@ -1525,8 +1525,9 @@ - func gateway(name, namespace string, servers []*istiov1beta1.Server, opts ...GatewayOpt) *v1beta1.Gateway { - gw := &v1beta1.Gateway{ - ObjectMeta: metav1.ObjectMeta{ -- Name: name, -- Namespace: namespace, -+ Name: name, -+ Namespace: namespace, -+ Annotations: map[string]string{resources.MaistraManageRouteAnnotationKey: "false"}, - }, - Spec: istiov1beta1.Gateway{ - Servers: servers, diff --git a/pkg/reconciler/ingress/resources/gateway_test.go b/pkg/reconciler/ingress/resources/gateway_test.go ---- a/pkg/reconciler/ingress/resources/gateway_test.go (revision 2971960b1cf6f44bbf9146e22d0e31eb253d812f) -+++ b/pkg/reconciler/ingress/resources/gateway_test.go (date 1707289076385) -@@ -594,6 +594,7 @@ +index b3b63a51..e166e006 100644 +--- a/pkg/reconciler/ingress/resources/gateway_test.go ++++ b/pkg/reconciler/ingress/resources/gateway_test.go +@@ -618,6 +618,7 @@ func TestMakeWildcardGateways(t *testing.T) { Name: WildcardGatewayName(wildcardSecret.Name, "istio-system", "istio-ingressgateway"), Namespace: system.Namespace(), OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(wildcardSecret, secretGVK)}, @@ -67,7 +70,7 @@ diff --git a/pkg/reconciler/ingress/resources/gateway_test.go b/pkg/reconciler/i }, Spec: istiov1beta1.Gateway{ Selector: selector, -@@ -631,6 +632,7 @@ +@@ -655,6 +656,7 @@ func TestMakeWildcardGateways(t *testing.T) { Name: WildcardGatewayName(wildcardSecret.Name, system.Namespace(), "istio-ingressgateway"), Namespace: system.Namespace(), OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(wildcardSecret, secretGVK)}, @@ -75,23 +78,15 @@ diff --git a/pkg/reconciler/ingress/resources/gateway_test.go b/pkg/reconciler/i }, Spec: istiov1beta1.Gateway{ Selector: selector, -@@ -744,6 +746,7 @@ - Labels: map[string]string{ - networking.IngressLabelKey: "ingress", - }, -+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"}, - }, - Spec: istiov1beta1.Gateway{ - Selector: selector, -@@ -762,6 +765,7 @@ +@@ -759,6 +761,7 @@ func TestMakeExternalIngressGateways(t *testing.T) { Labels: map[string]string{ networking.IngressLabelKey: "ingress", }, + Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"}, }, Spec: istiov1beta1.Gateway{ - Selector: selector, -@@ -827,6 +831,7 @@ + Selector: sel, +@@ -912,6 +915,7 @@ func TestMakeIngressTLSGateways(t *testing.T) { Labels: map[string]string{ networking.IngressLabelKey: "ingress", }, @@ -99,7 +94,7 @@ diff --git a/pkg/reconciler/ingress/resources/gateway_test.go b/pkg/reconciler/i }, Spec: istiov1beta1.Gateway{ Selector: selector, -@@ -870,6 +875,7 @@ +@@ -955,6 +959,7 @@ func TestMakeIngressTLSGateways(t *testing.T) { Labels: map[string]string{ networking.IngressLabelKey: "ingress", }, @@ -107,7 +102,7 @@ diff --git a/pkg/reconciler/ingress/resources/gateway_test.go b/pkg/reconciler/i }, Spec: istiov1beta1.Gateway{ Selector: selector, -@@ -916,6 +922,7 @@ +@@ -1001,6 +1006,7 @@ func TestMakeIngressTLSGateways(t *testing.T) { Labels: map[string]string{ networking.IngressLabelKey: "ingress", }, @@ -115,11 +110,11 @@ diff --git a/pkg/reconciler/ingress/resources/gateway_test.go b/pkg/reconciler/i }, Spec: istiov1beta1.Gateway{ Selector: selector, -@@ -959,6 +966,7 @@ +@@ -1044,6 +1050,7 @@ func TestMakeIngressTLSGateways(t *testing.T) { Labels: map[string]string{ networking.IngressLabelKey: "ingress.com", }, + Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"}, }, Spec: istiov1beta1.Gateway{ - Selector: selector, + Selector: selector, \ No newline at end of file