fix: Incorrect format for istio gateways #1104

Signed-off-by: Son Bui <sonbv00@gmail.com>
This commit is contained in:
Son Bui
2023-08-28 20:46:30 +08:00
parent 7af4498fd4
commit 2e4fe73d34
13 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ spec:
portName: http
portDiscovery: true
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
- mesh
hosts:
- app.example.com
+1 -1
View File
@@ -21,7 +21,7 @@ spec:
portName: http
portDiscovery: true
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
- mesh
hosts:
- app.example.com
+1 -1
View File
@@ -20,7 +20,7 @@ helm upgrade -i frontend flagger/podinfo \
--set backend=http://backend.test:9898/echo \
--set canary.enabled=true \
--set canary.istioIngress.enabled=true \
--set canary.istioIngress.gateway=public-gateway.istio-system.svc.cluster.local \
--set canary.istioIngress.gateway=istio-system/public-gateway \
--set canary.istioIngress.host=frontend.istio.example.com
```
+1 -1
View File
@@ -25,7 +25,7 @@ canary:
istioIngress:
enabled: false
# Istio ingress gateway name
gateway: public-gateway.istio-system.svc.cluster.local
gateway: istio-system/public-gateway
# external host name eg. podinfo.example.com
host:
analysis:
+5 -5
View File
@@ -558,7 +558,7 @@ spec:
portName: http-frontend
# Istio gateways (optional)
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
- mesh
# Istio virtual service host names (optional)
hosts:
@@ -614,7 +614,7 @@ metadata:
uid: 3a4a40dd-3875-11e9-8e1d-42010a9c0fd1
spec:
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
- mesh
hosts:
- frontend.example.com
@@ -784,7 +784,7 @@ metadata:
namespace: test
spec:
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
- mesh
hosts:
- frontend.example.com
@@ -821,7 +821,7 @@ spec:
service:
port: 8080
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
hosts:
- my-site.com
match:
@@ -838,7 +838,7 @@ spec:
service:
port: 8080
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
hosts:
- my-site.com
match:
@@ -383,7 +383,7 @@ spec:
hosts:
- "grafana.example.com"
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
http:
- route:
- destination:
+2 -2
View File
@@ -50,7 +50,7 @@ helm upgrade -i frontend flagger/podinfo \
--set backend=http://backend.test:9898/echo \
--set canary.enabled=true \
--set canary.istioIngress.enabled=true \
--set canary.istioIngress.gateway=public-gateway.istio-system.svc.cluster.local \
--set canary.istioIngress.gateway=istio-system/public-gateway \
--set canary.istioIngress.host=frontend.istio.example.com
```
@@ -278,7 +278,7 @@ spec:
enabled: true
istioIngress:
enabled: true
gateway: public-gateway.istio-system.svc.cluster.local
gateway: istio-system/public-gateway
host: frontend.istio.example.com
loadtest:
enabled: true
+1 -1
View File
@@ -92,7 +92,7 @@ spec:
port: 9898
# Istio gateways (optional)
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
# Istio virtual service host names (optional)
hosts:
- app.example.com
@@ -95,7 +95,7 @@ spec:
targetPort: 9898
# Istio gateways (optional)
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
# Istio virtual service host names (optional)
hosts:
- app.example.com
@@ -326,7 +326,7 @@ spec:
targetPort: 9898
# Istio gateways (optional)
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
# Istio virtual service host names (optional)
hosts:
- app.example.com
@@ -172,7 +172,7 @@ spec:
service:
port: 9898
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
hosts:
- app.example.com
retries:
+4 -4
View File
@@ -80,7 +80,7 @@ func TestIstioRouter_Sync(t *testing.T) {
// test drift
vsClone := vs.DeepCopy()
gateways := vsClone.Spec.Gateways
gateways = append(gateways, "test-gateway.istio-system")
gateways = append(gateways, "istio-system/test-gateway")
vsClone.Spec.Gateways = gateways
totalGateways := len(mocks.canary.Spec.Service.Gateways)
@@ -542,7 +542,7 @@ func TestIstioRouter_Delegate(t *testing.T) {
if len(mocks.canary.Spec.Service.Gateways) == 0 {
// in this case, the gateways or hosts should not be not empty because it requires to cause an error.
mocks.canary.Spec.Service.Gateways = []string{
"public-gateway.istio",
"istio/public-gateway",
"mesh",
}
}
@@ -583,7 +583,7 @@ func TestIstioRouter_Finalize(t *testing.T) {
kubectlSpec := &istiov1alpha3.VirtualServiceSpec{
Hosts: []string{"podinfo"},
Gateways: []string{"ingressgateway.istio-system.svc.cluster.local"},
Gateways: []string{"istio-system/ingressgateway"},
Http: []istiov1alpha3.HTTPRoute{
{
Match: nil,
@@ -631,7 +631,7 @@ func TestIstioRouter_Finalize(t *testing.T) {
require.NoError(t, err)
vs.Annotations[configAnnotation] = string(b)
case "kubectl":
vs.Annotations[kubectlAnnotation] = `{"apiVersion": "networking.istio.io/v1alpha3","kind": "VirtualService","metadata": {"annotations": {},"name": "podinfo","namespace": "test"}, "spec": {"gateways": ["ingressgateway.istio-system.svc.cluster.local"],"hosts": ["podinfo"],"http": [{"route": [{"destination": {"host": "podinfo"}}]}]}}`
vs.Annotations[kubectlAnnotation] = `{"apiVersion": "networking.istio.io/v1alpha3","kind": "VirtualService","metadata": {"annotations": {},"name": "podinfo","namespace": "test"}, "spec": {"gateways": ["istio-system/ingressgateway"],"hosts": ["podinfo"],"http": [{"route": [{"destination": {"host": "podinfo"}}]}]}}`
}
_, err = router.istioClient.NetworkingV1alpha3().VirtualServices(table.canary.Namespace).Update(context.TODO(), vs, metav1.UpdateOptions{})
require.NoError(t, err)
+1 -1
View File
@@ -178,7 +178,7 @@ func newTestCanary() *flaggerv1.Canary {
RetryOn: "connect-failure,gateway-error",
},
Gateways: []string{
"public-gateway.istio",
"istio/public-gateway",
"mesh",
},
}, Analysis: &flaggerv1.CanaryAnalysis{
+1 -1
View File
@@ -467,7 +467,7 @@ metadata:
namespace: test
spec:
gateways:
- ingressgateway.istio-system.svc.cluster.local
- istio-system/ingressgateway
hosts:
- app.example.com
- podinfo