Skip to content

Commit

Permalink
fix: Incorrect format for istio gateways #1104
Browse files Browse the repository at this point in the history
Signed-off-by: Son Bui <sonbv00@gmail.com>
  • Loading branch information
sonbui00 committed Aug 26, 2023
1 parent 7fc007a commit ae252f2
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion artifacts/examples/istio-abtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion artifacts/examples/istio-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/podinfo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion charts/podinfo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions docs/gitbook/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/gitbook/install/flagger-install-on-google-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ spec:
hosts:
- "grafana.example.com"
gateways:
- public-gateway.istio-system.svc.cluster.local
- istio-system/public-gateway
http:
- route:
- destination:
Expand Down
4 changes: 2 additions & 2 deletions docs/gitbook/tutorials/canary-helm-gitops.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/gitbook/tutorials/istio-ab-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/gitbook/tutorials/istio-progressive-delivery.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/gitbook/tutorials/zero-downtime-deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions pkg/router/istio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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",
}
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/router/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion test/istio/test-canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ metadata:
namespace: test
spec:
gateways:
- ingressgateway.istio-system.svc.cluster.local
- istio-system/ingressgateway
hosts:
- app.example.com
- podinfo
Expand Down

0 comments on commit ae252f2

Please sign in to comment.