You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if condition.type == "InstallPlanPending" and condition.status == "True" then
161
+
numPending = numPending + 1
162
+
elseif (condition.type == "InstallPlanMissing" and condition.reason ~= "ReferencedInstallPlanNotFound") then
163
+
numDegraded = numDegraded + 1
164
+
elseif (condition.type == "CatalogSourcesUnhealthy" or condition.type == "InstallPlanFailed" or condition.type == "ResolutionFailed") and condition.status == "True" then
165
+
numDegraded = numDegraded + 1
166
+
end
167
+
end
168
+
end
169
+
170
+
-- Available states: undef/nil, UpgradeAvailable, UpgradePending, UpgradeFailed, AtLatestKnown
-- we consider the Application Healthy only when the health status is Healthy AND it's synced
226
+
if obj.status.health.status == "Healthy" and (obj.status.sync and obj.status.sync.status or nil) == "Synced" then
227
+
health_status.status = "Healthy"
228
+
health_status.message = (obj.status.health.message or "Application is healthy and synced")
229
+
return health_status
230
+
end
231
+
-- We consider the Application Degraded only when the Sync failed for 'retry.limit' times
232
+
if obj.status.operationState ~= nil then
233
+
local retryLimit = (obj.status.operationState.operation and obj.status.operationState.operation.retry and obj.status.operationState.operation.retry.limit or nil)
234
+
local retryCount = (obj.status.operationState.retryCount or nil)
235
+
if retryLimit == retryCount and obj.status.operationState.phase ~= "Succeeded" then
236
+
health_status.status = "Degraded"
237
+
health_status.message = "Retry limit reached and sync didn't succeed"
238
+
end
239
+
end
240
+
end
241
+
end
242
+
return health_status`,
243
+
})
244
+
}
127
245
128
246
s:= argooperator.ArgoCD{
129
247
TypeMeta: metav1.TypeMeta{
@@ -254,94 +372,7 @@ g, admin, role:admin`
254
372
kinds:
255
373
- TaskRun
256
374
- PipelineRun`,
257
-
// We can drop this custom Subscription healthcheck once https://www.github.com/argoproj/argo-cd/issues/25921 is fixed
if condition.type == "InstallPlanPending" and condition.status == "True" then
292
-
numPending = numPending + 1
293
-
elseif (condition.type == "InstallPlanMissing" and condition.reason ~= "ReferencedInstallPlanNotFound") then
294
-
numDegraded = numDegraded + 1
295
-
elseif (condition.type == "CatalogSourcesUnhealthy" or condition.type == "InstallPlanFailed" or condition.type == "ResolutionFailed") and condition.status == "True" then
296
-
numDegraded = numDegraded + 1
297
-
end
298
-
end
299
-
end
300
-
301
-
-- Available states: undef/nil, UpgradeAvailable, UpgradePending, UpgradeFailed, AtLatestKnown
0 commit comments