mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
psmdb.percona.com/PerconaServerMongoDB resource customization (#20628)
Signed-off-by: Niv Amitai <niv@connecteam.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
local hs = {}
|
||||
if obj.status ~= nil then
|
||||
local state_map = {
|
||||
initializing = "Progressing",
|
||||
ready = "Healthy",
|
||||
error = "Degraded",
|
||||
stopping = "Progressing",
|
||||
paused = "Suspended"
|
||||
}
|
||||
|
||||
hs.status = state_map[obj.status.state] or "Unknown"
|
||||
hs.message = obj.status.ready .. "/" .. obj.status.size .. " node(s) are ready"
|
||||
return hs
|
||||
end
|
||||
|
||||
hs.status = "Unknown"
|
||||
hs.message = "Cluster status is unknown"
|
||||
return hs
|
||||
@@ -0,0 +1,25 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "0/9 node(s) are ready"
|
||||
inputPath: testdata/initializing.yaml
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "9/9 node(s) are ready"
|
||||
inputPath: testdata/ready.yaml
|
||||
- healthStatus:
|
||||
status: Suspended
|
||||
message: "0/9 node(s) are ready"
|
||||
inputPath: testdata/paused.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "6/9 node(s) are ready"
|
||||
inputPath: testdata/stopping.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "0/9 node(s) are ready"
|
||||
inputPath: testdata/error.yaml
|
||||
- healthStatus:
|
||||
status: Unknown
|
||||
message: "0/0 node(s) are ready"
|
||||
inputPath: testdata/unknown.yaml
|
||||
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/error.yaml
vendored
Normal file
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/error.yaml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: psmdb.percona.com/v1
|
||||
kind: PerconaServerMongoDB
|
||||
metadata:
|
||||
name: cluster
|
||||
spec: {}
|
||||
status:
|
||||
mongos:
|
||||
ready: 0
|
||||
size: 3
|
||||
status: error
|
||||
observedGeneration: 1
|
||||
ready: 0
|
||||
replsets:
|
||||
cfg:
|
||||
initialized: true
|
||||
ready: 0
|
||||
size: 3
|
||||
status: error
|
||||
rs0:
|
||||
initialized: true
|
||||
ready: 0
|
||||
size: 3
|
||||
status: error
|
||||
size: 9
|
||||
state: error
|
||||
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/initializing.yaml
vendored
Normal file
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/initializing.yaml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: psmdb.percona.com/v1
|
||||
kind: PerconaServerMongoDB
|
||||
metadata:
|
||||
name: cluster
|
||||
spec: {}
|
||||
status:
|
||||
mongos:
|
||||
ready: 0
|
||||
size: 3
|
||||
status: initializing
|
||||
observedGeneration: 1
|
||||
ready: 0
|
||||
replsets:
|
||||
cfg:
|
||||
initialized: false
|
||||
ready: 0
|
||||
size: 3
|
||||
status: initializing
|
||||
rs0:
|
||||
initialized: false
|
||||
ready: 0
|
||||
size: 3
|
||||
status: initializing
|
||||
size: 9
|
||||
state: initializing
|
||||
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/paused.yaml
vendored
Normal file
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/paused.yaml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: psmdb.percona.com/v1
|
||||
kind: PerconaServerMongoDB
|
||||
metadata:
|
||||
name: cluster
|
||||
spec: {}
|
||||
status:
|
||||
mongos:
|
||||
ready: 0
|
||||
size: 3
|
||||
status: paused
|
||||
observedGeneration: 1
|
||||
ready: 0
|
||||
replsets:
|
||||
cfg:
|
||||
initialized: true
|
||||
ready: 0
|
||||
size: 3
|
||||
status: paused
|
||||
rs0:
|
||||
initialized: true
|
||||
ready: 0
|
||||
size: 3
|
||||
status: paused
|
||||
size: 9
|
||||
state: paused
|
||||
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/ready.yaml
vendored
Normal file
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/ready.yaml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: psmdb.percona.com/v1
|
||||
kind: PerconaServerMongoDB
|
||||
metadata:
|
||||
name: cluster
|
||||
spec: {}
|
||||
status:
|
||||
mongos:
|
||||
ready: 3
|
||||
size: 3
|
||||
status: ready
|
||||
observedGeneration: 1
|
||||
ready: 9
|
||||
replsets:
|
||||
cfg:
|
||||
initialized: true
|
||||
ready: 3
|
||||
size: 3
|
||||
status: ready
|
||||
rs0:
|
||||
initialized: true
|
||||
ready: 3
|
||||
size: 3
|
||||
status: ready
|
||||
size: 9
|
||||
state: ready
|
||||
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/stopping.yaml
vendored
Normal file
25
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/stopping.yaml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: psmdb.percona.com/v1
|
||||
kind: PerconaServerMongoDB
|
||||
metadata:
|
||||
name: cluster
|
||||
spec: {}
|
||||
status:
|
||||
mongos:
|
||||
ready: 2
|
||||
size: 3
|
||||
status: stopping
|
||||
observedGeneration: 1
|
||||
ready: 6
|
||||
replsets:
|
||||
cfg:
|
||||
initialized: true
|
||||
ready: 2
|
||||
size: 3
|
||||
status: stopping
|
||||
rs0:
|
||||
initialized: true
|
||||
ready: 2
|
||||
size: 3
|
||||
status: stopping
|
||||
size: 9
|
||||
state: stopping
|
||||
10
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/unknown.yaml
vendored
Normal file
10
resource_customizations/psmdb.percona.com/PerconaServerMongoDB/testdata/unknown.yaml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: psmdb.percona.com/v1
|
||||
kind: PerconaServerMongoDB
|
||||
metadata:
|
||||
name: cluster
|
||||
spec: {}
|
||||
status:
|
||||
observedGeneration: 1
|
||||
ready: 0
|
||||
size: 0
|
||||
state: ""
|
||||
Reference in New Issue
Block a user