argo-cd/resource_customizations/core.humio.com/HumioCluster/health.lua
Togie Mcdogie 1cd6fcac4f
feat(health): Added Humio Operator Healthchecks (#11628)
* Added Humio Operator Healthchecks

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

* Retrigger CI pipeline

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

* Removed duplicate if statement from HumioView

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

* Add HumioCluster Health Check

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

---------

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-08 19:21:56 +03:00

67 lines
No EOL
2 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