Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added healthcheck for ArgoEvents EventBus CRD. #12395 #12401

Merged
merged 5 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions resource_customizations/argoproj.io/EventBus/health.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
hs={ status = "Progressing", message = "Waiting for initialization" }

if obj.status ~= nil then
if obj.status.conditions ~= nil then
for _, condition in ipairs(obj.status.conditions) do
if condition.type == "Deployed" and condition.status == "False" then
hs.status = "Degraded"
hs.message = condition.message or condition.reason
return hs
end
if condition.type == "Deployed" and condition.status == "True" then
hs.status = "Healthy"
hs.message = condition.message or condition.reason
return hs
end
end
end
end


return hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tests:
- healthStatus:
status: Healthy
message: "JetStream is deployed"
inputPath: testdata/healthy.yaml
- healthStatus:
status: Degraded
message: 'failed to get jetstream version, err: unsupported version "iwillfail", supported versions: "2.9.5,latest"'
inputPath: testdata/degraded.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: test
namespace: eventbus-test
spec:
jetstream:
replicas: 3
version: iwillfail
status:
conditions:
- lastTransitionTime: null
status: 'True'
type: Configured
- lastTransitionTime: null
message: >-
failed to get jetstream version, err: unsupported version "iwillfail",
supported versions: "2.9.5,latest"
reason: JetStreamStatefulSetFailed
status: 'False'
type: Deployed
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: test
namespace: eventbus-test
spec:
jetstream:
replicas: 3
version: latest
status:
conditions:
- lastTransitionTime: '2022-12-30T11:44:15Z'
status: 'True'
type: Configured
- lastTransitionTime: '2022-12-30T11:44:15Z'
message: JetStream is deployed
reason: Succeeded
status: 'True'
type: Deployed