Skip to content

Commit

Permalink
fix: Objects with .status: {} should return Healthy (#746)
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Johansson <richard.jimmy.johansson@gmail.com>
  • Loading branch information
illrill authored Apr 9, 2024
1 parent 486ea9d commit c347076
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions content/knowledge-base/integrations/argo-cd-crossplane.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ data:
"ProviderConfigUsage"
}
if obj.status == nil and contains(has_no_status, obj.kind) then
if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
health_status.status = "Healthy"
health_status.message = "Resource is up-to-date."
return health_status
end
if obj.status == nil or obj.status.conditions == nil then
if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
health_status.status = "Healthy"
health_status.message = "Resource is in use."
Expand Down Expand Up @@ -137,18 +137,18 @@ data:
"ProviderConfig",
"ProviderConfigUsage"
}
if obj.status == nil and contains(has_no_status, obj.kind) then
if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
health_status.status = "Healthy"
health_status.message = "Resource is up-to-date."
return health_status
end
if obj.status == nil or obj.status.conditions == nil then
if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
health_status.status = "Healthy"
health_status.message = "Resource is in use."
return health_status
end
if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
health_status.status = "Healthy"
health_status.message = "Resource is in use."
return health_status
end
return health_status
end
Expand Down

0 comments on commit c347076

Please sign in to comment.