Open snuggie12 opened 2 years ago
@snuggie12, I confirm this fix it for 1.54.0 operator installed with helm under the cm key:
resource.customizations: |
kiali.io/Kiali:
health.lua.useOpenLibs: true
health.lua: |-
hs = {}
if obj.status ~= nil then
if obj.status.environment ~= nil then
if obj.status.environment.operatorVersion ~= nil then
version = obj.status.environment.operatorVersion
_, _, major, minor, patch = version:find("v(%d+)%.(%d+)%.(%d+)")
if obj.status.conditions ~= nil then
for i, condition in ipairs(obj.status.conditions) do
hs.message = condition.message
minor = tonumber(minor)
if minor > 56 then
if condition.type == "Successful" and condition.status == "True" then
hs.status = "Healthy"
return hs
end
if condition.type == "Failure" and condition.status == "True" then
hs.status = "Degraded"
return hs
end
if condition.type == "Running" and condition.reason == "Running" then
hs.status = "Progressing"
return hs
end
else
if condition.reason == "Successful" then
hs.status = "Healthy"
return hs
elseif condition.reason == "Running" then
hs.status = "Progressing"
return hs
else
hs.status = "Degraded"
return hs
end
end
end
end
end
end
We use kustomize to install argocd, but I think we're also wrapping up our istio 1.16 upgrade which means we should be above the kiali version.
I think the correct course is just to check it into the built-in health checks in this repo. At the time I think I was having some issue being able to contribute to this repo. Maybe you can make a PR?
Checklist:
argocd version
.Describe the bug In https://github.com/argoproj/argo-cd/pull/10995 kiali's health check was updated to handle
v1.57.1
. I'm going to assume it's fine, but if you are using an earlier version then you are stuck continuously progressing.I'll paste a most likely working version below. I say most likely because I obviously don't have the newer version of kiali and I use openlibs to perform the regex.
It compares the minor version of kiali and then follows the current health check if
v1.57.X
and above or follow the old one if below. Happy to make a PR but saw the contribution guide says to file an issue first so doing that.To Reproduce Use kiali version lower than
v1.57.1
(at the very least I'm onv1.37.0
) and argocdv2.5.1+504da42
. App should be stuck inprogressing
due to.status.conditions[0].reason
beingSuccessful
where as the new health check is.status.conditions[0].type
beingSuccessful
.Expected behavior Health check works with both version ranges of kiali operator.
Screenshots
Version
Candidate Working Health Check