You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When checking the status of a lot of components, where only the name differs, it can be useful to be able to create a for loop. So you only have to declare once the assertion you want to check, and a list with names. For example in this simple check:
There are many ways this could be implemented. This is just a idea
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: running-deployments
spec:
bindings: <-- Because bindings is already a option in Chainsaw, maybe its good to use it also for lists
- name: deployments
values: app1, app2
template: true
timeouts:
assert: 120s
steps:
for deploy in ($deployments) <-- Start for loop
- try:
- assert:
resource:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ($deploy) <-- The selected deployment
status:
(readyReplicas == replicas): true
(conditions[?type == 'Available']):
- status: 'True'
Alternatives
No response
Additional Context
No response
Slack discussion
No response
Research
I have searched other issues in this repository and mine is not recorded.
The text was updated successfully, but these errors were encountered:
Problem Statement
When checking the status of a lot of components, where only the name differs, it can be useful to be able to create a for loop. So you only have to declare once the assertion you want to check, and a list with names. For example in this simple check:
Solution Description
There are many ways this could be implemented. This is just a idea
Alternatives
No response
Additional Context
No response
Slack discussion
No response
Research
The text was updated successfully, but these errors were encountered: