From c34707678e6efdb247f3886ced4b35f00cb4c5db Mon Sep 17 00:00:00 2001 From: Richard Johansson Date: Tue, 9 Apr 2024 17:24:56 +0200 Subject: [PATCH] fix: Objects with .status: {} should return Healthy (#746) Signed-off-by: Richard Johansson --- .../integrations/argo-cd-crossplane.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/content/knowledge-base/integrations/argo-cd-crossplane.md b/content/knowledge-base/integrations/argo-cd-crossplane.md index 9767832e..a27fc7f6 100644 --- a/content/knowledge-base/integrations/argo-cd-crossplane.md +++ b/content/knowledge-base/integrations/argo-cd-crossplane.md @@ -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." @@ -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