github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/iammanager.keikoproj.io/Iamrole/health.lua (about) 1 local hs = {} 2 if obj.status ~= nil then 3 -- Each message may or may not use these. 4 local roleName = obj.status.roleName or "<none>" 5 local roleARN = obj.status.roleARN or "<none>" 6 local roleID = obj.status.roleID or "<none>" 7 8 if obj.status.state == "Ready" then 9 hs.status = "Healthy" 10 hs.message = "Role '" .. roleName .. "' exists with ARN '" .. roleARN .. "' and ID '" .. roleID .. "'." 11 return hs 12 end 13 14 local message = "" 15 -- Current non-ready statuses: https://github.com/keikoproj/iam-manager/blob/3aeb2f8ec3005e1c53a057b3b0f79e14a0e5b9cb/api/v1alpha1/iamrole_types.go#L150-L156 16 if obj.status.state == "Error" or obj.status.state == "RolesMaxLimitReached" or obj.status.state == "PolicyNotAllowed" or obj.status.state == "RoleNameNotAvailable" then 17 hs.status = "Degraded" 18 message = "Failed to reconcile the Iamrole " 19 if obj.status.retryCount ~= nil and obj.status.retryCount > 0 then 20 message = message .. "(retry " .. tostring(obj.status.retryCount) .. ") " 21 end 22 message = message .. "for role '" .. roleName .. "' with ARN '" .. roleARN .. "' and ID '" .. roleID .. "'." 23 if obj.status.errorDescription ~= nil then 24 message = message .. " Reconciliation error was: " .. obj.status.errorDescription 25 end 26 hs.message = message 27 return hs 28 end 29 end 30 31 hs.status = "Progressing" 32 hs.message = "Waiting for Iamrole to be reconciled" 33 return hs