Describe the bug
From documentation https://docs.kcp.io/api-syncagent/main/publish-resources/templating/ Section "Related Object Label Selectors", the fields .ClusterName and .ClusterPath should be available inside .spec.related[*].object.selector.matchLabels. But when creating an object using them, they resolve to empty string.
Steps To Reproduce
Easiest way to reproduce this by creating an object which would be valid if .ClusterName resolves and invalid if it doesn't. So for example something like this:
related:
- identifier: database-credentials
origin: service
kind: Secret
object:
selector:
matchLabels:
# this will result in the string "-bla" in the error logs
syncagent.kcp.io/selector: '{{ .ClusterName }}-bla'
This then results in an error in syncagent logs, saying that "-bla" is not a valid name. Note in the same example in .spec.naming.name resolves fine. Here is the full object for reference
apiVersion: syncagent.kcp.io/v1alpha1
kind: PublishedResource
metadata:
name: databases.internal.example
spec:
resource:
kind: MySQLDatabase
apiGroup: database.example.crossplane.io
versions: [v1]
naming:
# need to adjust it to prevent collisions (normally clustername is the namespace)
name: "{{ .ClusterName }}-{{ .Object.metadata.name | sha3short }}"
related:
- identifier: database-credentials
origin: service
kind: Secret
object:
selector:
matchLabels:
# this will result in the string "-bla" in the error logs
syncagent.kcp.io/selector: '{{ .ClusterName }}-bla'
rewrite:
template:
template: "{{ .Value }}"
namespace:
template:
template: "default"
Expected Behaviour
Should corerctly resolve the ClusterName in the aforementioned example
Additional Context
No response
Describe the bug
From documentation https://docs.kcp.io/api-syncagent/main/publish-resources/templating/ Section "Related Object Label Selectors", the fields .ClusterName and .ClusterPath should be available inside
.spec.related[*].object.selector.matchLabels. But when creating an object using them, they resolve to empty string.Steps To Reproduce
Easiest way to reproduce this by creating an object which would be valid if .ClusterName resolves and invalid if it doesn't. So for example something like this:
This then results in an error in syncagent logs, saying that "-bla" is not a valid name. Note in the same example in
.spec.naming.nameresolves fine. Here is the full object for referenceExpected Behaviour
Should corerctly resolve the ClusterName in the aforementioned example
Additional Context
No response