Skip to content

Commit

Permalink
fix: Add missing statuses to MinIO Tenant health check (argoproj#10815)
Browse files Browse the repository at this point in the history
Signed-off-by: dnskr <[email protected]>

Signed-off-by: dnskr <[email protected]>
  • Loading branch information
dnskr authored Oct 7, 2022
1 parent ee47700 commit 8e3b915
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resource_customizations/minio.min.io/Tenant/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,21 @@ if obj.status ~= nil then
health_status.message = obj.status.currentState
return health_status
end
if obj.status.currentState == "Tenant credentials are not set properly" then
health_status.status = "Degraded"
health_status.message = obj.status.currentState
return health_status
end
if obj.status.currentState == "Different versions across MinIO Pools" then
health_status.status = "Degraded"
health_status.message = obj.status.currentState
return health_status
end
if obj.status.currentState == "Pool Decommissioning Not Allowed" then
health_status.status = "Degraded"
health_status.message = obj.status.currentState
return health_status
end
health_status.status = "Progressing"
health_status.message = obj.status.currentState
return health_status
Expand Down
8 changes: 8 additions & 0 deletions resource_customizations/minio.min.io/Tenant/health_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@ tests:
status: Degraded
message: "Another MinIO Tenant already exists in the namespace"
inputPath: testdata/another_tenant_exists.yaml
- healthStatus:
status: Degraded
message: "Tenant credentials are not set properly"
inputPath: testdata/incorrect_tenant_credentials.yaml
- healthStatus:
status: Degraded
message: "Different versions across MinIO Pools"
inputPath: testdata/versions_mismatch.yaml
- healthStatus:
status: Degraded
message: "Pool Decommissioning Not Allowed"
inputPath: testdata/pool_decommissioning_not_allowed.yaml
- healthStatus:
status: Progressing
message: "<unknown status message>"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: minio.min.io/v2
kind: Tenant
metadata:
name: minio-tenant
spec:
image: minio/minio:latest
pools:
- name: pool-0
servers: 1
volumesPerServer: 4
status:
revision: 0
currentState: Tenant credentials are not set properly
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: minio.min.io/v2
kind: Tenant
metadata:
name: minio-tenant
spec:
image: minio/minio:latest
pools:
- name: pool-0
servers: 1
volumesPerServer: 4
status:
revision: 0
currentState: Pool Decommissioning Not Allowed

0 comments on commit 8e3b915

Please sign in to comment.