Files
efa8e3add9 feat(health): Added Humio Operator Healthchecks (#11628)
* Added Humio Operator Healthchecks

Signed-off-by: togie6 <[email protected]>

* Retrigger CI pipeline

Signed-off-by: togie6 <[email protected]>

* Removed duplicate if statement from HumioView

Signed-off-by: togie6 <[email protected]>

* Add HumioCluster Health Check

Signed-off-by: togie6 <[email protected]>

---------

Signed-off-by: togie6 <[email protected]>
Co-authored-by: pasha-codefresh <[email protected]>
2024-05-08 19:21:56 +03:00

67 lines
2.0 KiB
Lua

hs = {
status = "Progressing",
message = "Update in progress"
}
if obj.status == nil then
hs.status= "Progressing"
if obj.status.message ~= nil then
hs.message = obj.status.message
end
end
if obj.status ~= nil then
if obj.status.state ~= nil then
if obj.status.state == "Running" then
hs.status = "Healthy"
if obj.status.message ~= nil then
hs.message = obj.status.message
else
hs.message = "Cluster is in a healthy running state"
end
end
if obj.status.state == "Restarting" then
hs.status = "Progressing"
if obj.status.message ~= nil then
hs.message = obj.status.message
else
hs.message = "Cluster pods are being restarted"
end
end
if obj.status.state == "Upgrading" then
hs.status = "Progressing"
if obj.status.message ~= nil then
hs.message = obj.status.message
else
hs.message = "Cluster pods are being upgraded"
end
end
if obj.status.state == "ConfigError" then
hs.status = "Degraded"
if obj.status.message ~= nil then
hs.message = obj.status.message
else
hs.message = "User-provided cluster specification resulted in a configuration error"
end
end
if obj.status.state == "Pending" then
hs.status = "Progressing"
if obj.status.message ~= nil then
hs.message = obj.status.message
else
hs.message = "Cluster is waiting on resources to be provisioned"
end
end
if obj.status.state == "Unknown" then
hs.status = "Unknown"
if obj.status.message ~= nil then
hs.message = obj.status.message
else
hs.message = "Component state: Unknown."
end
end
end
return hs
end
return hs