From a583f66b0d613abd628dff0f7db1dcc47c38cf71 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 09:30:29 +0800 Subject: [PATCH] [Backport release-1.7] Fix: gateway message is wrong (#5751) Co-authored-by: Qiaozp --- charts/vela-core/templates/defwithtemplate/gateway.yaml | 9 +++++---- .../vela-minimal/templates/defwithtemplate/gateway.yaml | 9 +++++---- vela-templates/definitions/internal/trait/gateway.cue | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/charts/vela-core/templates/defwithtemplate/gateway.yaml b/charts/vela-core/templates/defwithtemplate/gateway.yaml index 8cf2fadb6..ede3f5c85 100644 --- a/charts/vela-core/templates/defwithtemplate/gateway.yaml +++ b/charts/vela-core/templates/defwithtemplate/gateway.yaml @@ -113,19 +113,20 @@ spec: } if context.outputs.ingress.status.loadBalancer.ingress != _|_ { let igs = context.outputs.ingress.status.loadBalancer.ingress + let host = context.outputs.ingress.spec.rules[0].host if igs[0].ip != _|_ { - if igs[0].host != _|_ { + if host != _|_ { message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip } - if igs[0].host == _|_ { + if host == _|_ { message: "Host not specified, visit the cluster or load balancer in front of the cluster with IP: " + igs[0].ip } } if igs[0].ip == _|_ { - if igs[0].host != _|_ { + if host != _|_ { message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host } - if igs[0].host != _|_ { + if host != _|_ { message: "Host not specified, visit the cluster or load balancer in front of the cluster" } } diff --git a/charts/vela-minimal/templates/defwithtemplate/gateway.yaml b/charts/vela-minimal/templates/defwithtemplate/gateway.yaml index 8cf2fadb6..ede3f5c85 100644 --- a/charts/vela-minimal/templates/defwithtemplate/gateway.yaml +++ b/charts/vela-minimal/templates/defwithtemplate/gateway.yaml @@ -113,19 +113,20 @@ spec: } if context.outputs.ingress.status.loadBalancer.ingress != _|_ { let igs = context.outputs.ingress.status.loadBalancer.ingress + let host = context.outputs.ingress.spec.rules[0].host if igs[0].ip != _|_ { - if igs[0].host != _|_ { + if host != _|_ { message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip } - if igs[0].host == _|_ { + if host == _|_ { message: "Host not specified, visit the cluster or load balancer in front of the cluster with IP: " + igs[0].ip } } if igs[0].ip == _|_ { - if igs[0].host != _|_ { + if host != _|_ { message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host } - if igs[0].host != _|_ { + if host != _|_ { message: "Host not specified, visit the cluster or load balancer in front of the cluster" } } diff --git a/vela-templates/definitions/internal/trait/gateway.cue b/vela-templates/definitions/internal/trait/gateway.cue index 0e801c1ff..5b12dec89 100644 --- a/vela-templates/definitions/internal/trait/gateway.cue +++ b/vela-templates/definitions/internal/trait/gateway.cue @@ -14,19 +14,20 @@ gateway: { } if context.outputs.ingress.status.loadBalancer.ingress != _|_ { let igs = context.outputs.ingress.status.loadBalancer.ingress + let host = context.outputs.ingress.spec.rules[0].host if igs[0].ip != _|_ { - if igs[0].host != _|_ { + if host != _|_ { message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip } - if igs[0].host == _|_ { + if host == _|_ { message: "Host not specified, visit the cluster or load balancer in front of the cluster with IP: " + igs[0].ip } } if igs[0].ip == _|_ { - if igs[0].host != _|_ { + if host != _|_ { message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host } - if igs[0].host != _|_ { + if host != _|_ { message: "Host not specified, visit the cluster or load balancer in front of the cluster" } }