Skip to content

Commit

Permalink
Update patch to reflect upstream changes (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReToCode authored Feb 7, 2024
1 parent a8ae6cf commit f2a2b2d
Showing 1 changed file with 48 additions and 34 deletions.
82 changes: 48 additions & 34 deletions openshift/patches/002-add-maistra-annotation.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
diff --git a/pkg/reconciler/ingress/resources/gateway.go b/pkg/reconciler/ingress/resources/gateway.go
--- a/pkg/reconciler/ingress/resources/gateway.go (revision 9914eca315000a757b0f48df69f59cdbb8f7ea23)
+++ b/pkg/reconciler/ingress/resources/gateway.go (revision 2b701027bfe7dca09d27c709b0cc5d66069a1f5b)
@@ -42,9 +42,10 @@
--- a/pkg/reconciler/ingress/resources/gateway.go (revision 2971960b1cf6f44bbf9146e22d0e31eb253d812f)
+++ b/pkg/reconciler/ingress/resources/gateway.go (date 1707288992469)
@@ -41,12 +41,13 @@
)

// GatewayHTTPPort is the HTTP port the gateways listen on.
const (
- GatewayHTTPPort = 80
- dns1123LabelMaxLength = 63 // Public for testing only.
- dns1123LabelFmt = "[a-zA-Z0-9](?:[-a-zA-Z0-9]*[a-zA-Z0-9])?"
- GatewayHTTPPort = 80
- ExternalGatewayHTTPSPort = 443
- ClusterLocalGatewayHTTPSPort = 8444
- dns1123LabelMaxLength = 63 // Public for testing only.
- dns1123LabelFmt = "[a-zA-Z0-9](?:[-a-zA-Z0-9]*[a-zA-Z0-9])?"
- localGatewayPostfix = "-local"
+ GatewayHTTPPort = 80
+ ExternalGatewayHTTPSPort = 443
+ ClusterLocalGatewayHTTPSPort = 8444
+ dns1123LabelMaxLength = 63 // Public for testing only.
+ dns1123LabelFmt = "[a-zA-Z0-9](?:[-a-zA-Z0-9]*[a-zA-Z0-9])?"
+ localGatewayPostfix = "-local"
+ MaistraManageRouteAnnotationKey = "maistra.io/manageRoute"
)

var httpServerPortName = "http-server"
@@ -199,6 +200,9 @@
@@ -202,6 +203,9 @@
Name: WildcardGatewayName(secret.Name, gatewayService.Namespace, gatewayService.Name),
Namespace: secret.Namespace,
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(secret, gvk)},
Expand All @@ -25,8 +31,8 @@ diff --git a/pkg/reconciler/ingress/resources/gateway.go b/pkg/reconciler/ingres
},
Spec: istiov1beta1.Gateway{
Selector: gatewayService.Spec.Selector,
@@ -254,6 +258,9 @@
// We need this label to find out all of Gateways of a given Ingress.
@@ -257,6 +261,9 @@
// We need this label to find out all Gateways of a given Ingress.
networking.IngressLabelKey: ing.GetName(),
},
+ Annotations: map[string]string{
Expand All @@ -35,77 +41,85 @@ 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 9914eca315000a757b0f48df69f59cdbb8f7ea23)
+++ b/pkg/reconciler/ingress/resources/gateway_test.go (revision 2b701027bfe7dca09d27c709b0cc5d66069a1f5b)
@@ -593,6 +593,7 @@
--- a/pkg/reconciler/ingress/resources/gateway_test.go (revision 2971960b1cf6f44bbf9146e22d0e31eb253d812f)
+++ b/pkg/reconciler/ingress/resources/gateway_test.go (date 1707289076385)
@@ -594,6 +594,7 @@
Name: WildcardGatewayName(wildcardSecret.Name, "istio-system", "istio-ingressgateway"),
Namespace: system.Namespace(),
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(wildcardSecret, secretGVK)},
+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"},
},
Spec: istiov1beta1.Gateway{
Selector: selector,
@@ -630,6 +631,7 @@
@@ -631,6 +632,7 @@
Name: WildcardGatewayName(wildcardSecret.Name, system.Namespace(), "istio-ingressgateway"),
Namespace: system.Namespace(),
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(wildcardSecret, secretGVK)},
+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"},
},
Spec: istiov1beta1.Gateway{
Selector: selector,
@@ -743,6 +745,7 @@
@@ -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 @@
Labels: map[string]string{
networking.IngressLabelKey: "ingress",
},
+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"},
},
Spec: istiov1beta1.Gateway{
Selector: selector,
@@ -761,6 +764,7 @@
@@ -827,6 +831,7 @@
Labels: map[string]string{
networking.IngressLabelKey: "ingress",
},
+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"},
},
Spec: istiov1beta1.Gateway{
Selector: selector,
@@ -824,6 +828,7 @@
@@ -870,6 +875,7 @@
Labels: map[string]string{
networking.IngressLabelKey: "ingress",
},
+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"},
},
Spec: istiov1beta1.Gateway{
Selector: selector,
@@ -866,6 +871,7 @@
@@ -916,6 +922,7 @@
Labels: map[string]string{
networking.IngressLabelKey: "ingress",
},
+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"},
},
Spec: istiov1beta1.Gateway{
Selector: selector,
@@ -908,6 +914,7 @@
@@ -959,6 +966,7 @@
Labels: map[string]string{
networking.IngressLabelKey: "ingress.com",
},
+ Annotations: map[string]string{MaistraManageRouteAnnotationKey: "false"},
},
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 9914eca315000a757b0f48df69f59cdbb8f7ea23)
+++ b/pkg/reconciler/ingress/ingress_test.go (revision 2b701027bfe7dca09d27c709b0cc5d66069a1f5b)
@@ -1323,8 +1323,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,

0 comments on commit f2a2b2d

Please sign in to comment.