Skip to content

Commit

Permalink
feat: add argo health check for Workspace resource (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
muse-sisay authored Oct 21, 2024
1 parent 32ee471 commit a339096
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions argocd/cloud/argocd-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,33 @@ data:
end
end
return hs
tf.upbound.io/Workspace:
health.lua: |
local hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
local installed = false
local healthy = false
for i, condition in ipairs(obj.status.conditions) do
if condition.type == "Ready" then
installed = condition.status == "True"
installed_message = condition.reason
elseif condition.type == "Synced" then
healthy = condition.status == "True"
healthy_message = condition.reason
end
end
if installed and healthy then
hs.status = "Healthy"
else
hs.status = "Degraded"
end
hs.message = installed_message .. " " .. healthy_message
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for wworkspace to finish running"
return hs

0 comments on commit a339096

Please sign in to comment.