-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
component:health-checkIssue related to built-in Health Check customizationsIssue related to built-in Health Check customizationsenhancementNew feature or requestNew feature or request
Description
Summary
Add a Lua script which maps a FlinkSessionJob's state to a ArgoCD health status.
Motivation
There is no current health check for FlinkSessionJob.
Proposal
local health_status = {}
local healthy_states = {
["RUNNING"] = true,
["CANCELED"] = true,
["FINISHED"] = true,
["SUSPENDED"] = true
}
if obj.status ~= nil and obj.status.jobStatus ~= nil then
if obj.status.jobStatus.state == nil and obj.status.error ~= nil then
health_status.status = "Degraded"
health_status.message = "FlinkSessionJob reconciliation failed: " .. obj.status.error
return health_status
end
if healthy_states[obj.status.jobStatus.state] then
health_status.status = "Healthy"
health_status.message = "FlinkSessionJob is successfully " .. obj.status.jobStatus.state
return health_status
end
if obj.status.jobStatus.state == "CREATED" or obj.status.jobStatus.state == "RECONCILING" then
health_status.status = "Progressing"
health_status.message = "FlinkSessionJob is reconciling"
return health_status
end
if obj.status.jobStatus.state == "FAILED" then
health_status.status = "Degraded"
health_status.message = "FlinkSessionJob failed: " .. obj.status.error
return health_status
end
end
health_status.status = "Unknown"
health_status.message = "Unknown FlinkSessionJob state"
return health_status
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component:health-checkIssue related to built-in Health Check customizationsIssue related to built-in Health Check customizationsenhancementNew feature or requestNew feature or request