Skip to content

Commit c347076

Browse files
authored
fix: Objects with .status: {} should return Healthy (#746)
Signed-off-by: Richard Johansson <[email protected]>
1 parent 486ea9d commit c347076

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

content/knowledge-base/integrations/argo-cd-crossplane.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ data:
7070
"ProviderConfigUsage"
7171
}
7272
73-
if obj.status == nil and contains(has_no_status, obj.kind) then
73+
if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
7474
health_status.status = "Healthy"
7575
health_status.message = "Resource is up-to-date."
7676
return health_status
7777
end
7878
79-
if obj.status == nil or obj.status.conditions == nil then
79+
if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
8080
if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
8181
health_status.status = "Healthy"
8282
health_status.message = "Resource is in use."
@@ -137,18 +137,18 @@ data:
137137
"ProviderConfig",
138138
"ProviderConfigUsage"
139139
}
140-
if obj.status == nil and contains(has_no_status, obj.kind) then
140+
if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
141141
health_status.status = "Healthy"
142142
health_status.message = "Resource is up-to-date."
143143
return health_status
144144
end
145145
146-
if obj.status == nil or obj.status.conditions == nil then
147-
if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
148-
health_status.status = "Healthy"
149-
health_status.message = "Resource is in use."
150-
return health_status
151-
end
146+
if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
147+
if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
148+
health_status.status = "Healthy"
149+
health_status.message = "Resource is in use."
150+
return health_status
151+
end
152152
return health_status
153153
end
154154

0 commit comments

Comments
 (0)