diff --git a/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml b/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml index c57ebbc5..104d4675 100644 --- a/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml +++ b/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml @@ -5,56 +5,57 @@ kind: InferenceService check: | health_status = {} + health_status.status = "Progressing" + health_status.message = "Waiting for InferenceService to report status..." + if obj.status ~= nil then + progressing = false + + if obj.modelStatus ~= nil then + if obj.modelStatus.transitionStatus == "InProgress" then + progressing = true + end + end + if obj.status.conditions ~= nil then msg = "" - progressing = false - degraded = false + for i, condition in pairs(obj.status.conditions) do - if condition.message == nil then - message = "" - else - message = condition.message - end + status_false = 0 + status_unknown = 0 - if condition.reason == nil then - reason = "" - else - message = condition.reason - end - if condition.status == "Unknown" then - progressing = true - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. reason .. " | " .. message .. "\n" + if condition.status == "Unknown" then + status_unknown = status_unknown + 1 elseif condition.status == "False" then - if condition.type == "LatestDeploymentReady" then - progressing = true - else - degraded = true + status_false = status_false + 1 + end + + if condition.status ~= "True" then + msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status + if condition.reason ~= nil and condition.reason ~= "" then + msg = msg .. " | " condition.reason + end + if condition.message ~= nil and condition.message ~= "" then + msg = msg .. " | " condition.message end - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. reason .. " | " .. message .. "\n" + msg = msg .. "\n" end end - if progressing == false and degraded == false then + if progressing == false and status_unknown == 0 and status_false == 0 then health_status.status = "Healthy" elseif progressing == true then health_status.status = "Progressing" - elseif degraded == true then + else health_status.status = "Degraded" end health_status.message = msg - else - health_status.status = "Progressing" - health_status.message = "InferenceService is creating..." end - else - health_status.status = "Progressing" - health_status.message = "Waiting for InferenceService to report status..." end return health_status