Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
hs = {}
if obj ~= nil and obj.status ~= nil then
if type(obj.status.conditions) == "table" then
for i, condition in ipairs(obj.status.conditions) do
if condition ~= nil and
((condition.type == "Succeeded" and condition.status == "False") or
(condition.type == "Failed" and condition.status == "True")) then
hs.status = "Degraded"
hs.message = condition.message or ""
return hs
end
end
hs.status = "Healthy"
hs.message = "Ready to use"
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for status"
return hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tests:
- healthStatus:
status: Progressing
message: Waiting for status
inputPath: testdata/progressing.yaml
- healthStatus:
status: Degraded
message: 'ServiceBinding create failed'
inputPath: testdata/degraded.yaml
- healthStatus:
status: Healthy
message: 'Ready to use'
inputPath: testdata/healthy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
annotations:
creationTimestamp: '2025-08-14T00:38:55Z'
generation: 1
name: new-binding
namespace: sap
resourceVersion: '1'
uid: 9c7cad9e-11e2-473f-8061-475a727b9069
spec:
credentialsRotationPolicy:
enabled: true
rotatedBindingTTL: 20h
rotationFrequency: 20h
externalName: new-binding
secretName: new-binding
secretTemplate: |
apiVersion: v1
kind: Secret
metadata:
labels:
reloader: enabled
serviceInstanceName: instance-name
serviceInstanceNamespace: sap
userInfo:
groups:
- group1
uid: faa21265-03b1-42c2-9f50-90893470e7c3
username: user-name
status:
bindingID: 1603017e-f77b-4de4-b5f4-5fd275797f2d
conditions:
- lastTransitionTime: '2025-08-14T00:38:55Z'
message: ServiceBinding create failed
observedGeneration: 1
reason: CreateFailed
status: 'False'
type: Succeeded
- lastTransitionTime: '2025-08-14T00:40:38Z'
message: ServiceBinding create failed
observedGeneration: 1
reason: CreateFailed
status: 'True'
type: Failed
instanceID: 0ef2bec2-c0e2-443c-a865-0ebcecc00aca
ready: 'False'
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
annotations:
creationTimestamp: '2025-08-14T00:38:55Z'
generation: 1
name: new-binding
namespace: sap
resourceVersion: '1'
uid: 9c7cad9e-11e2-473f-8061-475a727b9069
spec:
credentialsRotationPolicy:
enabled: true
rotatedBindingTTL: 20h
rotationFrequency: 20h
externalName: new-binding
secretName: new-binding
secretTemplate: |
apiVersion: v1
kind: Secret
metadata:
labels:
reloader: enabled
serviceInstanceName: instance-name
serviceInstanceNamespace: sap
userInfo:
groups:
- group1
uid: faa21265-03b1-42c2-9f50-90893470e7c3
username: user-name
status:
bindingID: 1603017e-f77b-4de4-b5f4-5fd275797f2d
conditions:
- lastTransitionTime: '2025-08-14T00:38:55Z'
message: ServiceBinding provisioned successfully
observedGeneration: 1
reason: Created
status: 'True'
type: Succeeded
- lastTransitionTime: '2025-08-14T00:38:55Z'
message: ServiceBinding provisioned successfully
observedGeneration: 1
reason: Provisioned
status: 'True'
type: Ready
instanceID: 0ef2bec2-c0e2-443c-a865-0ebcecc00aca
ready: 'True'
subaccountID: e4316201-dcaa-436b-8069-fa366a56c6b3
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
annotations:
creationTimestamp: '2025-08-14T00:38:55Z'
generation: 1
name: new-binding
namespace: sap
resourceVersion: '1'
uid: 9c7cad9e-11e2-473f-8061-475a727b9069
spec:
credentialsRotationPolicy:
enabled: true
rotatedBindingTTL: 20h
rotationFrequency: 20h
externalName: new-binding
secretName: new-binding
secretTemplate: |
apiVersion: v1
kind: Secret
metadata:
labels:
reloader: enabled
serviceInstanceName: instance-name
serviceInstanceNamespace: sap
userInfo:
groups:
- group1
uid: faa21265-03b1-42c2-9f50-90893470e7c3
username: user-name
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
hs = {}
if obj ~= nil and obj.status ~= nil then
if type(obj.status.conditions) == "table" then
for i, condition in ipairs(obj.status.conditions) do
if condition ~= nil and
((condition.type == "Succeeded" and condition.status == "False") or
(condition.type == "Failed" and condition.status == "True")) then
hs.status = "Degraded"
hs.message = condition.message or ""
return hs
end
end
hs.status = "Healthy"
hs.message = "Ready to use"
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for status"
return hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tests:
- healthStatus:
status: Progressing
message: Waiting for status
inputPath: testdata/progressing.yaml
- healthStatus:
status: Degraded
message: 'ServiceInstance update failed'
inputPath: testdata/degraded.yaml
- healthStatus:
status: Healthy
message: 'Ready to use'
inputPath: testdata/healthy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
annotations:
creationTimestamp: '2025-08-14T00:38:55Z'
generation: 1
name: new-service
namespace: sap
resourceVersion: '1'
uid: 9c7cad9e-11e2-473f-8061-475a727b9069
spec:
externalName: new-service-instance
serviceOfferingName: my-service
servicePlanName: my-plan
userInfo:
groups:
- group1
uid: faa21265-03b1-42c2-9f50-90893470e7c3
username: user-name
status:
bindingID: 1603017e-f77b-4de4-b5f4-5fd275797f2d
conditions:
- lastTransitionTime: '2025-08-14T00:38:55Z'
message: ServiceInstance update failed
observedGeneration: 1
reason: UpdateFailed
status: 'False'
type: Succeeded
- lastTransitionTime: '2025-08-14T00:38:55Z'
message: ServiceInstance update failed
observedGeneration: 1
reason: UpdateFailed
status: 'True'
type: Failed
instanceID: 0ef2bec2-c0e2-443c-a865-0ebcecc00aca
ready: 'True'
hashedSpec: e4316201-dcaa-436b-8069-fa366a56c6b3
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
annotations:
creationTimestamp: '2025-08-14T00:38:55Z'
generation: 1
name: new-service
namespace: sap
resourceVersion: '1'
uid: 9c7cad9e-11e2-473f-8061-475a727b9069
spec:
externalName: new-service-instance
serviceOfferingName: my-service
servicePlanName: my-plan
userInfo:
groups:
- group1
uid: faa21265-03b1-42c2-9f50-90893470e7c3
username: user-name
status:
bindingID: 1603017e-f77b-4de4-b5f4-5fd275797f2d
conditions:
- lastTransitionTime: '2025-08-14T00:38:55Z'
message: ServiceInstance updated successfully
observedGeneration: 1
reason: Updated
status: 'True'
type: Succeeded
- lastTransitionTime: '2025-08-14T00:38:55Z'
message: ServiceInstance updated successfully
observedGeneration: 1
reason: Provisioned
status: 'True'
type: Ready
instanceID: 0ef2bec2-c0e2-443c-a865-0ebcecc00aca
ready: 'True'
hashedSpec: e4316201-dcaa-436b-8069-fa366a56c6b3
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
annotations:
creationTimestamp: '2025-08-14T00:38:55Z'
generation: 1
name: new-service
namespace: sap
resourceVersion: '1'
uid: 9c7cad9e-11e2-473f-8061-475a727b9069
spec:
externalName: new-service-instance
serviceOfferingName: my-service
servicePlanName: my-plan
userInfo:
groups:
- group1
uid: faa21265-03b1-42c2-9f50-90893470e7c3
username: user-name
Loading