-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(health): add Logstash resource customization #22028
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
Changes from 3 commits
8b310d3
6c675ce
46b6194
13c23f8
3aa40c8
5e4b870
871a3e5
1b0543d
21c212a
e942a73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| local hs = {} | ||
| if obj.status ~= nil then | ||
| if 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 | ||
| end | ||
|
|
||
| hs.status = "Unknown" | ||
| hs.message = "Logstash status is unknown. Ensure your ArgoCD is current and then check for/file a bug report: https://github.com/argoproj/argo-cd/issues" | ||
|
||
| return hs | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: Unknown | ||
| message: "Logstash status is unknown. Ensure your ArgoCD is current and then check for/file a bug report: https://github.com/argoproj/argo-cd/issues" | ||
| inputPath: testdata/unknown.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: logstash.k8s.elastic.co/v1alpha1 | ||
| kind: Logstash | ||
| metadata: | ||
| name: quickstart | ||
| status: | ||
| health: green |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: logstash.k8s.elastic.co/v1alpha1 | ||
| kind: Logstash | ||
| metadata: | ||
| name: quickstart | ||
| status: | ||
| health: red |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: logstash.k8s.elastic.co/v1alpha1 | ||
| kind: Logstash | ||
| metadata: | ||
| name: quickstart | ||
| status: {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: logstash.k8s.elastic.co/v1alpha1 | ||
| kind: Logstash | ||
| metadata: | ||
| name: quickstart | ||
| status: | ||
| health: yellow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you consolidate in one if using and?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.