mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 08:57:17 +00:00
feat(health): add Logstash resource customization (#22028)
Signed-off-by: Francis Provencher <fprovencher@drw.com>
This commit is contained in:
parent
6174b94d6a
commit
8f1f5c7234
6 changed files with 60 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
local hs = {}
|
||||
if obj.status ~= nil and obj.status.health ~= nil then
|
||||
if obj.status.health == "green" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "Logstash status is Green"
|
||||
return hs
|
||||
elseif obj.status.health == "yellow" then
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Logstash status is Yellow"
|
||||
return hs
|
||||
elseif obj.status.health == "red" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = "Logstash status is Red"
|
||||
return hs
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for Logstash"
|
||||
return hs
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "Logstash status is Green"
|
||||
inputPath: testdata/green.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Logstash status is Yellow"
|
||||
inputPath: testdata/yellow.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Logstash status is Red"
|
||||
inputPath: testdata/red.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for Logstash"
|
||||
inputPath: testdata/unknown.yaml
|
||||
6
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/green.yaml
vendored
Normal file
6
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/green.yaml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: logstash.k8s.elastic.co/v1alpha1
|
||||
kind: Logstash
|
||||
metadata:
|
||||
name: quickstart
|
||||
status:
|
||||
health: green
|
||||
6
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/red.yaml
vendored
Normal file
6
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/red.yaml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: logstash.k8s.elastic.co/v1alpha1
|
||||
kind: Logstash
|
||||
metadata:
|
||||
name: quickstart
|
||||
status:
|
||||
health: red
|
||||
5
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/unknown.yaml
vendored
Normal file
5
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/unknown.yaml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
apiVersion: logstash.k8s.elastic.co/v1alpha1
|
||||
kind: Logstash
|
||||
metadata:
|
||||
name: quickstart
|
||||
status: {}
|
||||
6
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/yellow.yaml
vendored
Normal file
6
resource_customizations/logstash.k8s.elastic.co/Logstash/testdata/yellow.yaml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: logstash.k8s.elastic.co/v1alpha1
|
||||
kind: Logstash
|
||||
metadata:
|
||||
name: quickstart
|
||||
status:
|
||||
health: yellow
|
||||
Loading…
Reference in a new issue