diff --git a/charts/vela-core/templates/defwithtemplate/ingress.yaml b/charts/vela-core/templates/defwithtemplate/ingress.yaml index a6e49548f..fcb5a9221 100644 --- a/charts/vela-core/templates/defwithtemplate/ingress.yaml +++ b/charts/vela-core/templates/defwithtemplate/ingress.yaml @@ -10,11 +10,17 @@ metadata: spec: status: customStatus: |- - if len(context.outputs.ingress.status.loadBalancer.ingress) > 0 { - message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + context.outputs.ingress.status.loadBalancer.ingress[0].ip + let igs = context.outputs.ingress.status.loadBalancer.ingress + if igs == _|_ { + message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + " --route'\n" } - if len(context.outputs.ingress.status.loadBalancer.ingress) == 0 { - message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + " --route'\n" + if len(igs) > 0 { + if igs[0].ip != _|_ { + message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip + } + if igs[0].ip == _|_ { + message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + } } healthPolicy: | isHealth: len(context.outputs.service.spec.clusterIP) > 0 diff --git a/charts/vela-core/templates/defwithtemplate/worker.yaml b/charts/vela-core/templates/defwithtemplate/worker.yaml index 4f3a12ae2..6672d7527 100644 --- a/charts/vela-core/templates/defwithtemplate/worker.yaml +++ b/charts/vela-core/templates/defwithtemplate/worker.yaml @@ -36,15 +36,6 @@ spec: command: parameter.cmd } - if parameter["volumes"] != _|_ { - volumeMounts: [ for v in parameter.volumes { - { - mountPath: v.mountPath - name: v.name - } - }] - } - if parameter["volumes"] != _|_ { volumeMounts: [ for v in parameter.volumes { { diff --git a/hack/vela-templates/cue/worker.cue b/hack/vela-templates/cue/worker.cue index f12f5607d..fd449d38f 100644 --- a/hack/vela-templates/cue/worker.cue +++ b/hack/vela-templates/cue/worker.cue @@ -20,15 +20,6 @@ output: { command: parameter.cmd } - if parameter["volumes"] != _|_ { - volumeMounts: [ for v in parameter.volumes { - { - mountPath: v.mountPath - name: v.name - } - }] - } - if parameter["volumes"] != _|_ { volumeMounts: [ for v in parameter.volumes { { diff --git a/hack/vela-templates/definitions/ingress.yaml b/hack/vela-templates/definitions/ingress.yaml index dd57ec897..f8dcae313 100644 --- a/hack/vela-templates/definitions/ingress.yaml +++ b/hack/vela-templates/definitions/ingress.yaml @@ -9,11 +9,17 @@ metadata: spec: status: customStatus: |- - if len(context.outputs.ingress.status.loadBalancer.ingress) > 0 { - message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + context.outputs.ingress.status.loadBalancer.ingress[0].ip + let igs = context.outputs.ingress.status.loadBalancer.ingress + if igs == _|_ { + message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + " --route'\n" } - if len(context.outputs.ingress.status.loadBalancer.ingress) == 0 { - message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + " --route'\n" + if len(igs) > 0 { + if igs[0].ip != _|_ { + message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip + } + if igs[0].ip == _|_ { + message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + } } healthPolicy: | isHealth: len(context.outputs.service.spec.clusterIP) > 0