argo-cd/resource_customizations/flink.apache.org/FlinkDeployment/health.lua
ChangZhuo Chen (陳昌倬) dd56fc9e87
feat: support health check on FlinkDeployment (#9300) (#9300)
Signed-off-by: ChangZhuo Chen (陳昌倬) <czchen@czchen.org>
2022-06-08 10:05:03 -04:00

24 lines
773 B
Lua

health_status = {}
if obj.status ~= nil and obj.status.reconciliationStatus ~= nil then
if obj.status.reconciliationStatus.success then
health_status.status = "Healthy"
return health_status
end
if obj.status.jobManagerDeploymentStatus == "DEPLOYED_NOT_READY" or obj.status.jobManagerDeploymentStatus == "DEPLOYING" then
health_status.status = "Progressing"
health_status.message = "Waiting for deploying"
return health_status
end
if obj.status.jobManagerDeploymentStatus == "ERROR" then
health_status.status = "Degraded"
health_status.message = obj.status.reconciliationStatus.error
return health_status
end
end
health_status.status = "Progressing"
health_status.message = "Waiting for Flink operator"
return health_status