mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
Merge 5841d667bd into e0e827dab0
This commit is contained in:
commit
71196932c8
15 changed files with 239 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
local health_status = {}
|
||||
if obj.metadata ~= nil and obj.metadata.generation ~= nil and obj.status ~= nil and obj.status.observedGeneration ~= nil and obj.metadata.generation ~= obj.status.observedGeneration then
|
||||
health_status.status = "Progressing"
|
||||
health_status.message = "Waiting for DataScienceCluster spec update to be observed"
|
||||
return health_status
|
||||
end
|
||||
if obj.status ~= nil and obj.status.phase ~= nil then
|
||||
if obj.status.phase == "Ready" then
|
||||
health_status.status = "Healthy"
|
||||
health_status.message = "DataScienceCluster is ready"
|
||||
return health_status
|
||||
end
|
||||
if obj.status.phase == "Error" then
|
||||
health_status.status = "Degraded"
|
||||
health_status.message = obj.status.errorMessage or "DataScienceCluster encountered an error"
|
||||
return health_status
|
||||
end
|
||||
end
|
||||
health_status.status = "Progressing"
|
||||
health_status.message = "Waiting for DataScienceCluster to become ready"
|
||||
return health_status
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "DataScienceCluster is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for DataScienceCluster to become ready"
|
||||
inputPath: testdata/progressing.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for DataScienceCluster to become ready"
|
||||
inputPath: testdata/progressing_not_ready.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for DataScienceCluster spec update to be observed"
|
||||
inputPath: testdata/stale_generation.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "component dashboard is in error state"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for DataScienceCluster to become ready"
|
||||
inputPath: testdata/no_status.yaml
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
apiVersion: datasciencecluster.opendatahub.io/v1
|
||||
kind: DataScienceCluster
|
||||
metadata:
|
||||
name: default-dsc
|
||||
namespace: opendatahub
|
||||
spec:
|
||||
components:
|
||||
dashboard:
|
||||
managementState: Managed
|
||||
status:
|
||||
phase: Error
|
||||
errorMessage: "component dashboard is in error state"
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "False"
|
||||
reason: Error
|
||||
message: "component dashboard is in error state"
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: datasciencecluster.opendatahub.io/v1
|
||||
kind: DataScienceCluster
|
||||
metadata:
|
||||
name: default-dsc
|
||||
namespace: opendatahub
|
||||
spec:
|
||||
components:
|
||||
dashboard:
|
||||
managementState: Managed
|
||||
status:
|
||||
phase: Ready
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
reason: Ready
|
||||
message: "All components are ready"
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
apiVersion: datasciencecluster.opendatahub.io/v1
|
||||
kind: DataScienceCluster
|
||||
metadata:
|
||||
name: default-dsc
|
||||
namespace: opendatahub
|
||||
spec:
|
||||
components:
|
||||
dashboard:
|
||||
managementState: Managed
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: datasciencecluster.opendatahub.io/v1
|
||||
kind: DataScienceCluster
|
||||
metadata:
|
||||
name: default-dsc
|
||||
namespace: opendatahub
|
||||
spec:
|
||||
components:
|
||||
dashboard:
|
||||
managementState: Managed
|
||||
status:
|
||||
phase: Progressing
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "Unknown"
|
||||
reason: Progressing
|
||||
message: "Reconciliation in progress"
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: datasciencecluster.opendatahub.io/v1
|
||||
kind: DataScienceCluster
|
||||
metadata:
|
||||
name: default-dsc
|
||||
namespace: opendatahub
|
||||
spec:
|
||||
components:
|
||||
dashboard:
|
||||
managementState: Managed
|
||||
status:
|
||||
phase: "Not Ready"
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "False"
|
||||
reason: NotReady
|
||||
message: "Some components are not ready"
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: datasciencecluster.opendatahub.io/v1
|
||||
kind: DataScienceCluster
|
||||
metadata:
|
||||
name: default-dsc
|
||||
namespace: opendatahub
|
||||
generation: 2
|
||||
spec:
|
||||
components:
|
||||
dashboard:
|
||||
managementState: Managed
|
||||
status:
|
||||
phase: Ready
|
||||
observedGeneration: 1
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
reason: Ready
|
||||
message: "All components are ready"
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
local health_status = {}
|
||||
if obj.metadata ~= nil and obj.metadata.generation ~= nil and obj.status ~= nil and obj.status.observedGeneration ~= nil and obj.metadata.generation ~= obj.status.observedGeneration then
|
||||
health_status.status = "Progressing"
|
||||
health_status.message = "Waiting for DSCInitialization spec update to be observed"
|
||||
return health_status
|
||||
end
|
||||
if obj.status ~= nil and obj.status.phase ~= nil then
|
||||
if obj.status.phase == "Ready" then
|
||||
health_status.status = "Healthy"
|
||||
health_status.message = "DSCInitialization is ready"
|
||||
return health_status
|
||||
end
|
||||
if obj.status.phase == "Error" then
|
||||
health_status.status = "Degraded"
|
||||
health_status.message = obj.status.errorMessage or "DSCInitialization encountered an error"
|
||||
return health_status
|
||||
end
|
||||
end
|
||||
health_status.status = "Progressing"
|
||||
health_status.message = "Waiting for DSCInitialization to become ready"
|
||||
return health_status
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "DSCInitialization is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for DSCInitialization to become ready"
|
||||
inputPath: testdata/progressing.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for DSCInitialization to become ready"
|
||||
inputPath: testdata/progressing_not_ready.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "failed to configure monitoring"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for DSCInitialization to become ready"
|
||||
inputPath: testdata/no_status.yaml
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
apiVersion: dscinitialization.opendatahub.io/v1
|
||||
kind: DSCInitialization
|
||||
metadata:
|
||||
name: default-dsci
|
||||
spec:
|
||||
applicationsNamespace: opendatahub
|
||||
status:
|
||||
phase: Error
|
||||
errorMessage: "failed to configure monitoring"
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "False"
|
||||
reason: Error
|
||||
message: "failed to configure monitoring"
|
||||
13
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/testdata/healthy.yaml
vendored
Normal file
13
resource_customizations/dscinitialization.opendatahub.io/DSCInitialization/testdata/healthy.yaml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: dscinitialization.opendatahub.io/v1
|
||||
kind: DSCInitialization
|
||||
metadata:
|
||||
name: default-dsci
|
||||
spec:
|
||||
applicationsNamespace: opendatahub
|
||||
status:
|
||||
phase: Ready
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
reason: Ready
|
||||
message: "DSCInitialization is ready"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: dscinitialization.opendatahub.io/v1
|
||||
kind: DSCInitialization
|
||||
metadata:
|
||||
name: default-dsci
|
||||
spec:
|
||||
applicationsNamespace: opendatahub
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: dscinitialization.opendatahub.io/v1
|
||||
kind: DSCInitialization
|
||||
metadata:
|
||||
name: default-dsci
|
||||
spec:
|
||||
applicationsNamespace: opendatahub
|
||||
status:
|
||||
phase: Progressing
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "Unknown"
|
||||
reason: Progressing
|
||||
message: "Reconciliation in progress"
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: dscinitialization.opendatahub.io/v1
|
||||
kind: DSCInitialization
|
||||
metadata:
|
||||
name: default-dsci
|
||||
spec:
|
||||
applicationsNamespace: opendatahub
|
||||
status:
|
||||
phase: "Not Ready"
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "False"
|
||||
reason: NotReady
|
||||
message: "DSCInitialization is not ready"
|
||||
Loading…
Reference in a new issue