mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
Signed-off-by: Adriano Machado <60320+ammachado@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
local hs = {}
|
||||
|
||||
if obj ~= nil and obj.status ~= nil then
|
||||
local deployments = obj.status.deployments
|
||||
if deployments ~= nil then
|
||||
local has_ready = deployments.ready ~= nil
|
||||
local has_starting = deployments.starting ~= nil
|
||||
local has_stopped = deployments.stopped ~= nil
|
||||
|
||||
if has_ready and (not has_starting) and (not has_stopped) then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale APIManager is available"
|
||||
return hs
|
||||
elseif (has_ready and (has_starting or has_stopped)) or (not has_ready) then
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale APIManager status..."
|
||||
end
|
||||
end
|
||||
|
||||
-- Fallback to condition-based evaluation
|
||||
if obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "Available" then
|
||||
if condition.status == "True" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale APIManager is available"
|
||||
return hs
|
||||
elseif condition.reason ~= nil and condition.reason ~= "" then
|
||||
local msg = "3scale APIManager is degraded: " .. condition.reason
|
||||
hs.status = "Degraded"
|
||||
hs.message = msg
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale APIManager status..."
|
||||
return hs
|
||||
@@ -0,0 +1,21 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "3scale APIManager is degraded: MissingWatchedSecrets"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale APIManager is available"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale APIManager status..."
|
||||
inputPath: testdata/progressing-1.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale APIManager status..."
|
||||
inputPath: testdata/progressing-2.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale APIManager status..."
|
||||
inputPath: testdata/progressing-3.yaml
|
||||
7
resource_customizations/apps.3scale.net/APIManager/testdata/degraded.yaml
vendored
Normal file
7
resource_customizations/apps.3scale.net/APIManager/testdata/degraded.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: apps.3scale.net/v1alpha1
|
||||
kind: APIManager
|
||||
status:
|
||||
conditions:
|
||||
- type: Available
|
||||
status: "False"
|
||||
reason: "MissingWatchedSecrets"
|
||||
8
resource_customizations/apps.3scale.net/APIManager/testdata/healthy.yaml
vendored
Normal file
8
resource_customizations/apps.3scale.net/APIManager/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: apps.3scale.net/v1alpha1
|
||||
kind: APIManager
|
||||
status:
|
||||
conditions:
|
||||
- status: "True"
|
||||
type: Available
|
||||
deployments:
|
||||
ready: []
|
||||
14
resource_customizations/apps.3scale.net/APIManager/testdata/progressing-1.yaml
vendored
Normal file
14
resource_customizations/apps.3scale.net/APIManager/testdata/progressing-1.yaml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: apps.3scale.net/v1alpha1
|
||||
kind: APIManager
|
||||
status:
|
||||
conditions:
|
||||
- status: "False"
|
||||
type: Available
|
||||
deployments:
|
||||
ready:
|
||||
- a
|
||||
starting:
|
||||
- b
|
||||
- c
|
||||
stopped:
|
||||
- e
|
||||
11
resource_customizations/apps.3scale.net/APIManager/testdata/progressing-2.yaml
vendored
Normal file
11
resource_customizations/apps.3scale.net/APIManager/testdata/progressing-2.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: apps.3scale.net/v1alpha1
|
||||
kind: APIManager
|
||||
status:
|
||||
conditions:
|
||||
- status: "False"
|
||||
type: Available
|
||||
deployments:
|
||||
starting:
|
||||
- a
|
||||
stopped:
|
||||
- b
|
||||
12
resource_customizations/apps.3scale.net/APIManager/testdata/progressing-3.yaml
vendored
Normal file
12
resource_customizations/apps.3scale.net/APIManager/testdata/progressing-3.yaml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: apps.3scale.net/v1alpha1
|
||||
kind: APIManager
|
||||
status:
|
||||
conditions:
|
||||
- status: "False"
|
||||
type: Available
|
||||
deployments:
|
||||
ready:
|
||||
- a
|
||||
starting:
|
||||
- b
|
||||
- c
|
||||
@@ -0,0 +1,27 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "Ready" and condition.status == "True" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale ActiveDoc is ready"
|
||||
return hs
|
||||
elseif condition.type == "Invalid" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale ActiveDoc configuration is invalid"
|
||||
return hs
|
||||
elseif condition.type == "Orphan" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale ActiveDoc references non-existing resources"
|
||||
return hs
|
||||
elseif condition.type == "Failed" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale ActiveDoc synchronization failed"
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale ActiveDoc status..."
|
||||
return hs
|
||||
@@ -0,0 +1,21 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale ActiveDoc is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failure message"
|
||||
inputPath: testdata/degraded-failed.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Validation failure"
|
||||
inputPath: testdata/degraded-invalid.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Referenced product does not exist"
|
||||
inputPath: testdata/degraded-orphan.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale ActiveDoc status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
7
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/degraded-failed.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/degraded-failed.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ActiveDoc
|
||||
status:
|
||||
conditions:
|
||||
- type: Failed
|
||||
status: "True"
|
||||
message: Failure message
|
||||
7
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/degraded-invalid.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/degraded-invalid.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ActiveDoc
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: Validation failure
|
||||
7
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/degraded-orphan.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/degraded-orphan.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ActiveDoc
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: Referenced product does not exist
|
||||
6
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/healthy.yaml
vendored
Normal file
6
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ActiveDoc
|
||||
status:
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
4
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/progressing.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/ActiveDoc/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ActiveDoc
|
||||
status:
|
||||
conditions: [ ]
|
||||
@@ -0,0 +1,32 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil then
|
||||
if obj.status.state ~= nil and obj.status.state == "suspended" then
|
||||
hs.status = "Suspended"
|
||||
hs.message = "3scale Application is suspended"
|
||||
return hs
|
||||
end
|
||||
|
||||
local application_id = obj.status.adminId
|
||||
local has_application_id = (application_id ~= nil and type(application_id) == "number" and application_id > 0)
|
||||
|
||||
if obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "Ready" then
|
||||
if condition.status == "True" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale Application is ready"
|
||||
return hs
|
||||
elseif not has_application_id then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale Application is not ready"
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale Application status..."
|
||||
return hs
|
||||
@@ -0,0 +1,17 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale Application is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failed to synchronize application with 3scale API"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Suspended
|
||||
message: "3scale Application is suspended"
|
||||
inputPath: testdata/suspended.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale Application status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
8
resource_customizations/capabilities.3scale.net/Application/testdata/degraded.yaml
vendored
Normal file
8
resource_customizations/capabilities.3scale.net/Application/testdata/degraded.yaml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Application
|
||||
status:
|
||||
applicationID: null
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "False"
|
||||
message: Failed to synchronize application with 3scale API
|
||||
8
resource_customizations/capabilities.3scale.net/Application/testdata/healthy.yaml
vendored
Normal file
8
resource_customizations/capabilities.3scale.net/Application/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Application
|
||||
status:
|
||||
applicationID: 123456
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
message: Application has been successfully synchronized
|
||||
4
resource_customizations/capabilities.3scale.net/Application/testdata/progressing.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/Application/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Application
|
||||
status:
|
||||
conditions: [ ]
|
||||
4
resource_customizations/capabilities.3scale.net/Application/testdata/suspended.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/Application/testdata/suspended.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Application
|
||||
status:
|
||||
state: suspended
|
||||
@@ -0,0 +1,23 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.status ~= "True" then goto continue end
|
||||
|
||||
if condition.type == "Ready" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale ApplicationAuth is ready"
|
||||
return hs
|
||||
elseif condition.type == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale ApplicationAuth failed"
|
||||
return hs
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale ApplicationAuth status..."
|
||||
return hs
|
||||
@@ -0,0 +1,13 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale ApplicationAuth is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failed to generate authentication secret"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale ApplicationAuth status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
7
resource_customizations/capabilities.3scale.net/ApplicationAuth/testdata/degraded.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/ApplicationAuth/testdata/degraded.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ApplicationAuth
|
||||
status:
|
||||
conditions:
|
||||
- type: Failed
|
||||
status: "True"
|
||||
message: Failed to generate authentication secret
|
||||
6
resource_customizations/capabilities.3scale.net/ApplicationAuth/testdata/healthy.yaml
vendored
Normal file
6
resource_customizations/capabilities.3scale.net/ApplicationAuth/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ApplicationAuth
|
||||
status:
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
4
resource_customizations/capabilities.3scale.net/ApplicationAuth/testdata/progressing.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/ApplicationAuth/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ApplicationAuth
|
||||
status:
|
||||
conditions: [ ]
|
||||
@@ -0,0 +1,27 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.status ~= "True" then goto continue end
|
||||
|
||||
if condition.type == "Synced" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale Backend is synced"
|
||||
return hs
|
||||
elseif condition.type == "Invalid" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale Backend configuration is invalid"
|
||||
return hs
|
||||
elseif condition.type == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale Backend synchronization failed"
|
||||
return hs
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale Backend status..."
|
||||
return hs
|
||||
@@ -0,0 +1,17 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale Backend is synced"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "3scale Backend synchronization failed"
|
||||
inputPath: testdata/degraded-failed.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "3scale Backend configuration is invalid"
|
||||
inputPath: testdata/degraded-invalid.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale Backend status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
10
resource_customizations/capabilities.3scale.net/Backend/testdata/degraded-failed.yaml
vendored
Normal file
10
resource_customizations/capabilities.3scale.net/Backend/testdata/degraded-failed.yaml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Backend
|
||||
status:
|
||||
conditions:
|
||||
- status: "True"
|
||||
type: Failed
|
||||
- status: "False"
|
||||
type: Invalid
|
||||
- status: "False"
|
||||
type: Synced
|
||||
11
resource_customizations/capabilities.3scale.net/Backend/testdata/degraded-invalid.yaml
vendored
Normal file
11
resource_customizations/capabilities.3scale.net/Backend/testdata/degraded-invalid.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Backend
|
||||
status:
|
||||
backendId: 59978
|
||||
conditions:
|
||||
- status: "False"
|
||||
type: Failed
|
||||
- status: "True"
|
||||
type: Invalid
|
||||
- status: "False"
|
||||
type: Synced
|
||||
11
resource_customizations/capabilities.3scale.net/Backend/testdata/degraded-not-synced.yaml
vendored
Normal file
11
resource_customizations/capabilities.3scale.net/Backend/testdata/degraded-not-synced.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Backend
|
||||
status:
|
||||
conditions:
|
||||
- status: "False"
|
||||
type: Failed
|
||||
- status: "False"
|
||||
type: Invalid
|
||||
- status: "False"
|
||||
type: Synced
|
||||
reason: SynchronizationFailed
|
||||
11
resource_customizations/capabilities.3scale.net/Backend/testdata/healthy.yaml
vendored
Normal file
11
resource_customizations/capabilities.3scale.net/Backend/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Backend
|
||||
status:
|
||||
backendId: 59978
|
||||
conditions:
|
||||
- status: "False"
|
||||
type: Failed
|
||||
- status: "False"
|
||||
type: Invalid
|
||||
- status: "True"
|
||||
type: Synced
|
||||
11
resource_customizations/capabilities.3scale.net/Backend/testdata/progressing.yaml
vendored
Normal file
11
resource_customizations/capabilities.3scale.net/Backend/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Backend
|
||||
status:
|
||||
backendId: 59978
|
||||
conditions:
|
||||
- status: "False"
|
||||
type: Failed
|
||||
- status: "False"
|
||||
type: Invalid
|
||||
- status: "False"
|
||||
type: Synced
|
||||
@@ -0,0 +1,23 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "Ready" and condition.status == "True" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale CustomPolicyDefinition is ready"
|
||||
return hs
|
||||
elseif condition.type == "Invalid" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale CustomPolicyDefinition configuration is invalid"
|
||||
return hs
|
||||
elseif condition.type == "Failed" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale CustomPolicyDefinition synchronization failed"
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale CustomPolicyDefinition status..."
|
||||
return hs
|
||||
@@ -0,0 +1,13 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale CustomPolicyDefinition is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Policy schema is invalid"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale CustomPolicyDefinition status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: CustomPolicyDefinition
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: Policy schema is invalid
|
||||
7
resource_customizations/capabilities.3scale.net/CustomPolicyDefinition/testdata/healthy.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/CustomPolicyDefinition/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: CustomPolicyDefinition
|
||||
status:
|
||||
policyID: 123456
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: CustomPolicyDefinition
|
||||
status:
|
||||
conditions: [ ]
|
||||
@@ -0,0 +1,31 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.status ~= "True" then goto continue end
|
||||
|
||||
if condition.type == "Ready" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale DeveloperAccount is ready"
|
||||
return hs
|
||||
elseif condition.type == "Invalid" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale DeveloperAccount configuration is invalid"
|
||||
return hs
|
||||
elseif condition.type == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale DeveloperAccount synchronization failed"
|
||||
return hs
|
||||
elseif condition.type == "Waiting" then
|
||||
hs.status = "Suspended"
|
||||
hs.message = condition.message or "3scale DeveloperAccount is waiting for approval"
|
||||
return hs
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale DeveloperAccount status..."
|
||||
return hs
|
||||
@@ -0,0 +1,21 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale DeveloperAccount is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Suspended
|
||||
message: "Developer account is waiting for admin approval"
|
||||
inputPath: testdata/waiting.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failure message"
|
||||
inputPath: testdata/degraded-failed.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Validation failure"
|
||||
inputPath: testdata/degraded-invalid.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale DeveloperAccount status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperAccount
|
||||
status:
|
||||
conditions:
|
||||
- type: Failed
|
||||
status: "True"
|
||||
message: Failure message
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperAccount
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: Validation failure
|
||||
6
resource_customizations/capabilities.3scale.net/DeveloperAccount/testdata/healthy.yaml
vendored
Normal file
6
resource_customizations/capabilities.3scale.net/DeveloperAccount/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperAccount
|
||||
status:
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
4
resource_customizations/capabilities.3scale.net/DeveloperAccount/testdata/progressing.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/DeveloperAccount/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperAccount
|
||||
status:
|
||||
conditions: [ ]
|
||||
7
resource_customizations/capabilities.3scale.net/DeveloperAccount/testdata/waiting.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/DeveloperAccount/testdata/waiting.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperAccount
|
||||
status:
|
||||
conditions:
|
||||
- type: Waiting
|
||||
status: "True"
|
||||
message: Developer account is waiting for admin approval
|
||||
@@ -0,0 +1,39 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil then
|
||||
if obj.status.developerUserState ~= nil and obj.status.developerUserState == "suspended" then
|
||||
hs.status = "Suspended"
|
||||
hs.message = "3scale Developer user is waiting for admin approval"
|
||||
return hs
|
||||
end
|
||||
|
||||
if obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.status ~= "True" then goto continue end
|
||||
|
||||
if condition.type == "Ready" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale DeveloperUser is ready"
|
||||
return hs
|
||||
elseif condition.type == "Invalid" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale DeveloperUser configuration is invalid"
|
||||
return hs
|
||||
elseif condition.type == "Orphan" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale DeveloperUser references non-existing resources"
|
||||
return hs
|
||||
elseif condition.type == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale DeveloperUser synchronization failed"
|
||||
return hs
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale DeveloperUser status..."
|
||||
return hs
|
||||
@@ -0,0 +1,25 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale DeveloperUser is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Suspended
|
||||
message: "3scale Developer user is waiting for admin approval"
|
||||
inputPath: testdata/suspended.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failure message"
|
||||
inputPath: testdata/degraded-failed.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Validation failure"
|
||||
inputPath: testdata/degraded-invalid.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Referenced developer account does not exist"
|
||||
inputPath: testdata/degraded-orphan.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale DeveloperUser status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
7
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/degraded-failed.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/degraded-failed.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ActiveDoc
|
||||
status:
|
||||
conditions:
|
||||
- type: Failed
|
||||
status: "True"
|
||||
message: Failure message
|
||||
7
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/degraded-invalid.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/degraded-invalid.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ActiveDoc
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: Validation failure
|
||||
7
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/degraded-orphan.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/degraded-orphan.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperUser
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: Referenced developer account does not exist
|
||||
6
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/healthy.yaml
vendored
Normal file
6
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperUser
|
||||
status:
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
4
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/progressing.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperUser
|
||||
status:
|
||||
conditions: [ ]
|
||||
4
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/suspended.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/DeveloperUser/testdata/suspended.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: DeveloperUser
|
||||
status:
|
||||
developerUserState: suspended
|
||||
@@ -0,0 +1,27 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.status ~= "True" then goto continue end
|
||||
|
||||
if condition.type == "Ready" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale OpenAPI is ready"
|
||||
return hs
|
||||
elseif condition.type == "Invalid" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale OpenAPI configuration is invalid"
|
||||
return hs
|
||||
elseif condition.type == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale OpenAPI reconciliation failed"
|
||||
return hs
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale OpenAPI status..."
|
||||
return hs
|
||||
@@ -0,0 +1,17 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale OpenAPI is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failure message"
|
||||
inputPath: testdata/degraded-failed.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "OpenAPI specification is invalid or malformed"
|
||||
inputPath: testdata/degraded-invalid.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale OpenAPI status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
7
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/degraded-failed.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/degraded-failed.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: OpenAPI
|
||||
status:
|
||||
conditions:
|
||||
- type: Failed
|
||||
status: "True"
|
||||
message: Failure message
|
||||
7
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/degraded-invalid.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/degraded-invalid.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: OpenAPI
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: OpenAPI specification is invalid or malformed
|
||||
6
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/healthy.yaml
vendored
Normal file
6
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: OpenAPI
|
||||
status:
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
4
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/progressing.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/OpenAPI/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: OpenAPI
|
||||
status:
|
||||
conditions: [ ]
|
||||
@@ -0,0 +1,31 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.status ~= "True" then goto continue end
|
||||
|
||||
if condition.type == "Synced" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale Product is synced"
|
||||
return hs
|
||||
elseif condition.type == "Invalid" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale Product configuration is invalid"
|
||||
return hs
|
||||
elseif condition.type == "Orphan" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale Product references non-existing resources"
|
||||
return hs
|
||||
elseif condition.type == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale Product synchronization failed"
|
||||
return hs
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale Product status..."
|
||||
return hs
|
||||
@@ -0,0 +1,21 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale Product is synced"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failure message"
|
||||
inputPath: testdata/degraded-failed.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Product configuration is invalid - missing required hits metric"
|
||||
inputPath: testdata/degraded-invalid.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Product spec contains reference(s) to non existing resources"
|
||||
inputPath: testdata/degraded-orphan.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale Product status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
7
resource_customizations/capabilities.3scale.net/Product/testdata/degraded-failed.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/Product/testdata/degraded-failed.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Product
|
||||
status:
|
||||
conditions:
|
||||
- type: Failed
|
||||
status: "True"
|
||||
message: Failure message
|
||||
7
resource_customizations/capabilities.3scale.net/Product/testdata/degraded-invalid.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/Product/testdata/degraded-invalid.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Product
|
||||
status:
|
||||
conditions:
|
||||
- type: Invalid
|
||||
status: "True"
|
||||
message: Product configuration is invalid - missing required hits metric
|
||||
7
resource_customizations/capabilities.3scale.net/Product/testdata/degraded-orphan.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/Product/testdata/degraded-orphan.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Product
|
||||
status:
|
||||
conditions:
|
||||
- type: Orphan
|
||||
status: "True"
|
||||
message: Product spec contains reference(s) to non existing resources
|
||||
7
resource_customizations/capabilities.3scale.net/Product/testdata/healthy.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/Product/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Product
|
||||
status:
|
||||
productId: 123456
|
||||
conditions:
|
||||
- type: Synced
|
||||
status: "True"
|
||||
20
resource_customizations/capabilities.3scale.net/Product/testdata/progressing.yaml
vendored
Normal file
20
resource_customizations/capabilities.3scale.net/Product/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: Product
|
||||
metadata:
|
||||
name: progressing-product
|
||||
namespace: example-ns
|
||||
spec:
|
||||
name: Progressing Product
|
||||
systemName: progressing_product
|
||||
description: Progressing product for testing
|
||||
metrics:
|
||||
hits:
|
||||
friendlyName: Hits
|
||||
unit: hit
|
||||
description: Number of API hits
|
||||
status:
|
||||
productId: null
|
||||
state: null
|
||||
providerAccountHost: example.3scale.net
|
||||
observedGeneration: 1
|
||||
conditions: [ ]
|
||||
@@ -0,0 +1,27 @@
|
||||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.status ~= "True" then goto continue end
|
||||
|
||||
if condition.type == "Ready" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale ProxyConfigPromote is ready"
|
||||
return hs
|
||||
elseif condition.type == "In-progress" then
|
||||
hs.status = "Progressing"
|
||||
hs.message = condition.message or "3scale ProxyConfigPromote is in progress"
|
||||
return hs
|
||||
elseif condition.type == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3cale ProxyConfigPromote failed"
|
||||
return hs
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale ProxyConfigPromote status..."
|
||||
return hs
|
||||
@@ -0,0 +1,17 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale ProxyConfigPromote is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failed to promote proxy configuration - product not found"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Proxy configuration promotion is in progress"
|
||||
inputPath: testdata/in-progress.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale ProxyConfigPromote status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
7
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/degraded.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/degraded.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ProxyConfigPromote
|
||||
status:
|
||||
conditions:
|
||||
- type: Failed
|
||||
status: "True"
|
||||
message: Failed to promote proxy configuration - product not found
|
||||
7
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/healthy.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ProxyConfigPromote
|
||||
status:
|
||||
productId: "123456"
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
7
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/in-progress.yaml
vendored
Normal file
7
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/in-progress.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ProxyConfigPromote
|
||||
status:
|
||||
conditions:
|
||||
- type: In-progress
|
||||
status: "True"
|
||||
message: Proxy configuration promotion is in progress
|
||||
4
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/progressing.yaml
vendored
Normal file
4
resource_customizations/capabilities.3scale.net/ProxyConfigPromote/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: capabilities.3scale.net/v1beta1
|
||||
kind: ProxyConfigPromote
|
||||
status:
|
||||
conditions: [ ]
|
||||
@@ -0,0 +1,38 @@
|
||||
local hs = {}
|
||||
|
||||
if obj ~= nil and obj.status ~= nil then
|
||||
local tenant_id = obj.status.tenantId
|
||||
local admin_id = obj.status.adminId
|
||||
local has_tenant_id = (tenant_id ~= nil and type(tenant_id) == "number" and tenant_id > 0)
|
||||
local has_admin_id = (admin_id ~= nil and type(admin_id) == "number" and admin_id > 0)
|
||||
|
||||
local is_ready = false
|
||||
if obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "Ready" and condition.status == "True" then
|
||||
is_ready = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if is_ready and has_tenant_id and has_admin_id then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "3scale Tenant is ready"
|
||||
return hs
|
||||
end
|
||||
|
||||
if obj.status.conditions ~= nil then
|
||||
for _, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "Ready" and condition.status ~= "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message or "3scale Tenant is degraded"
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for 3scale Tenant status..."
|
||||
return hs
|
||||
@@ -0,0 +1,13 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "3scale Tenant is ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Failed to create tenant - invalid credentials"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for 3scale Tenant status..."
|
||||
inputPath: testdata/progressing.yaml
|
||||
9
resource_customizations/capabilities.3scale.net/Tenant/testdata/degraded.yaml
vendored
Normal file
9
resource_customizations/capabilities.3scale.net/Tenant/testdata/degraded.yaml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: capabilities.3scale.net/v1alpha1
|
||||
kind: Tenant
|
||||
status:
|
||||
tenantId: 0
|
||||
adminId: 0
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "False"
|
||||
message: Failed to create tenant - invalid credentials
|
||||
11
resource_customizations/capabilities.3scale.net/Tenant/testdata/healthy.yaml
vendored
Normal file
11
resource_customizations/capabilities.3scale.net/Tenant/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: capabilities.3scale.net/v1alpha1
|
||||
kind: Tenant
|
||||
metadata:
|
||||
name: example-tenant
|
||||
namespace: example-ns
|
||||
status:
|
||||
tenantId: 123456
|
||||
adminId: 789
|
||||
conditions:
|
||||
- type: Ready
|
||||
status: "True"
|
||||
9
resource_customizations/capabilities.3scale.net/Tenant/testdata/progressing.yaml
vendored
Normal file
9
resource_customizations/capabilities.3scale.net/Tenant/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: capabilities.3scale.net/v1alpha1
|
||||
kind: Tenant
|
||||
metadata:
|
||||
name: progressing-tenant
|
||||
namespace: example-ns
|
||||
status:
|
||||
tenantId: 0
|
||||
adminId: 0
|
||||
conditions: [ ]
|
||||
Reference in New Issue
Block a user