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" } }