-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Labels
bugSomething isn't workingSomething isn't working
Description
chainsaw version Version
v0.2.12
Description
We would like to use binding inside the Apply
operations under the FileRefOrResource
for labels.
Steps to reproduce
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: my-test
spec:
steps:
- name: Create pod with labels
bindings:
- name: podName
value: pod-name
- name: labelName
value: my-label
- name: labelValue
value: "false"
try:
- apply:
template: true
resource:
apiVersion: v1
kind: Pod
metadata:
name: ($podName)
labels:
($labelName): ($labelValue)
Will result in:
=== ERROR
Pod "pod-name" is invalid: metadata.labels: Invalid value: "($labelName)": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')
Expected behavior
Bindings can be used anywhere inside the FileRefOrResource
.
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
bugSomething isn't workingSomething isn't working