github.com/argoproj/argo-cd@v1.8.7/resource_customizations/argoproj.io/AnalysisRun/health.lua (about) 1 hs = {} 2 3 function messageOrDefault(field, default) 4 if field ~= nil then 5 return field 6 end 7 return default 8 end 9 10 if obj.status ~= nil then 11 if obj.status.phase == "Pending" then 12 hs.status = "Progressing" 13 hs.message = "Analysis run is running" 14 end 15 if obj.status.phase == "Running" then 16 hs.status = "Progressing" 17 hs.message = "Analysis run is running" 18 end 19 if obj.status.phase == "Successful" then 20 hs.status = "Healthy" 21 hs.message = messageOrDefault(obj.status.message, "Analysis run completed successfully") 22 end 23 if obj.status.phase == "Failed" then 24 hs.status = "Degraded" 25 hs.message = messageOrDefault(obj.status.message, "Analysis run failed") 26 end 27 if obj.status.phase == "Error" then 28 hs.status = "Degraded" 29 hs.message = messageOrDefault(obj.status.message, "Analysis run had an error") 30 end 31 if obj.status.phase == "Inconclusive" then 32 hs.status = "Unknown" 33 hs.message = messageOrDefault(obj.status.message, "Analysis run was inconclusive") 34 end 35 return hs 36 end 37 38 hs.status = "Progressing" 39 hs.message = "Waiting for analysis run to finish: status has not been reconciled." 40 return hs