Skip to content

Commit d0fbce6

Browse files
committed
Align custom healthcheck with clustergroup
Here is the clusterwide argo default now: ``` oc get argocd -n vp-gitops vp-gitops -o jsonpath='{.spec.resourceHealthChecks}' | jq -r '.[].kind' PersistentVolumeClaim Subscription ```
1 parent c5bae1f commit d0fbce6

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

internal/controller/argo.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,27 @@ func newArgoCD(name, namespace string, patternsOperatorConfig PatternsOperatorCo
7474
argoScopes := "[groups,email]"
7575

7676
resourceHealthChecks := []argooperator.ResourceHealthCheck{
77+
{
78+
// https://www.github.com/argoproj/argo-cd/issues/12840 is related
79+
Kind: "PersistentVolumeClaim",
80+
Check: `hs = {}
81+
if obj.status ~= nil then
82+
if obj.status.phase ~= nil then
83+
if obj.status.phase == "Pending" then
84+
hs.status = "Healthy"
85+
hs.message = obj.status.phase
86+
return hs
87+
elseif obj.status.phase == "Bound" then
88+
hs.status = "Healthy"
89+
hs.message = obj.status.phase
90+
return hs
91+
end
92+
end
93+
end
94+
hs.status = "Progressing"
95+
hs.message = "Waiting for PVC"
96+
return hs`,
97+
},
7798
{
7899
// We can drop this custom Subscription healthcheck once https://www.github.com/argoproj/argo-cd/issues/25921 is fixed
79100
Group: "operators.coreos.com",

0 commit comments

Comments
 (0)