mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
feat(health): add Logstash resource customization (#22028)
Signed-off-by: Francis Provencher <fprovencher@drw.com>
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user