From aae7c71285103b53527f9e203329151b61fd407c Mon Sep 17 00:00:00 2001 From: Carsten Dietrich <3203968+carstendietrich@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:47:59 +0200 Subject: [PATCH] chore: If `k8sHealthCheckThroughIngress` is not set, there is no need for calling the ingress (#37) --- src/model/kube/statusFetcher.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/model/kube/statusFetcher.go b/src/model/kube/statusFetcher.go index 6b88e6b..bfd5b8a 100644 --- a/src/model/kube/statusFetcher.go +++ b/src/model/kube/statusFetcher.go @@ -429,13 +429,13 @@ func checkDeploymentWithHealthCheck(name string, app *vistectureCore.Application return d } - // Try to do the healthcheck also from (public) ingress - if an ingress exist and the check from service was ok - if len(k8sIngresses[k8sHealthCheckServiceName]) > 0 { - d.AppStateInfo.HealthyAlsoFromIngress = checkPublicHealth(k8sIngresses[k8sHealthCheckServiceName], app.Properties["healthCheckPath"]) - } - - // In case the application need to be checked from outside - let it fail + // In case the application need to be checked from outside, do the check and let it fail if unhealthy/misconfigured if _, ok := app.Properties["k8sHealthCheckThroughIngress"]; ok { + // Try to do the healthcheck from ingress + if len(k8sIngresses[k8sHealthCheckServiceName]) > 0 { + d.AppStateInfo.HealthyAlsoFromIngress = checkPublicHealth(k8sIngresses[k8sHealthCheckServiceName], app.Properties["healthCheckPath"]) + } + if !d.AppStateInfo.HealthyAlsoFromIngress { if len(k8sIngresses[k8sHealthCheckServiceName]) == 0 { d.AppStateInfo.State = State_failed