-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Labels
ContribfestGood first issues for KubeCon EU 2024Good first issues for KubeCon EU 2024bugSomething isn't workingSomething isn't working
Description
chainsaw version Version
v0.2.13
Description
It seems that it's not possible to replace the kind value in a patch operation with a value from a binding which looks like a bug to me.
The following example of a test step is working fine:
- name: Update to state STARTED
try:
- patch:
resource:
apiVersion: test/v1alpha1
kind: custom-kind
metadata:
name: ($apiName)
spec:
state: "STARTED"
- assert:
resource:
apiVersion: test/v1alpha1
kind: custom-kind
metadata:
name: ($apiName)
status:
state: STARTED
processingStatus: CompletedNotice that name: ($apiName) doesn't cause any trouble however this example with kind: ($apiKind) is not working:
- name: Update to state STARTED
try:
- patch:
resource:
apiVersion: test/v1alpha1
kind: ($apiKind)
metadata:
name: ($apiName)
spec:
state: "STARTED"
- assert:
resource:
apiVersion: test/v1alpha1
kind: ($apiKind)
metadata:
name: ($apiName)
status:
state: STARTED
processingStatus: CompletedThe test run fails before any steps is executed. Error message:
Loading tests...
Error: failed to validate resource (Test.chainsaw.kyverno.io "export-import" is invalid: spec.steps[4].try[0].patch.resource.kind: Invalid value: "($apiKind)": may have mixed case, but should otherwise match: a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'))BTW: In my case the binding was defined inside a scenarios bindings.
Steps to reproduce
Expected behavior
I would expect that I can use bindings for the kind value.
Screenshots
No response
Logs
Slack discussion
No response
Troubleshooting
- I have searched other issues in this repository and mine is not recorded.
Metadata
Metadata
Assignees
Labels
ContribfestGood first issues for KubeCon EU 2024Good first issues for KubeCon EU 2024bugSomething isn't workingSomething isn't working