Describe the bug
When a published resource is cluster-scoped, the default naming scheme {{ .Object.metadata.namespace | sha3short }}-{{ .Object.metadata.name | sha3short }} won't work cause sha3short requires a string input.
The local object will not be created.
Essentially this is not a bug but more of a convenience feature to have the defaults work in more usecases.
workaround:
Set a custom naming for the published resources, i.e.
spec:
naming:
name: "{{ .Object.metadata.name | sha3short }}"
Steps To Reproduce
- create a PublishedResource for a cluster-scoped object
- create APIExports and APIBindings
- create an instance of the resource
- check log entries in the api-syncagent primary pod
{"level":"error","time":"2026-04-30T06:06:01.526Z","logger":"syncagent-sync","caller":"controller/controller.go:495","msg":"Reconciler error","controller":"syncagent-sync","reconcileID":"a6c4a2ad-c31f-4d2b-99f3-179802f41453","error":"failed to create destination object: failed to create destination object: failed to generate local object name: invalid name naming: failed to evaluate: template: inline:1:32: executing \"inline\" at <sha3short>: invalid value; expected string"}
Expected Behaviour
The defaultNaming of local object works even for cluster-scoped published resources.
Additional Context
related source line:
https://github.com/kcp-dev/api-syncagent/blob/main/internal/sync/templating/naming.go#L53
Describe the bug
When a published resource is cluster-scoped, the default naming scheme
{{ .Object.metadata.namespace | sha3short }}-{{ .Object.metadata.name | sha3short }}won't work causesha3shortrequires a string input.The local object will not be created.
Essentially this is not a bug but more of a convenience feature to have the defaults work in more usecases.
workaround:
Set a custom naming for the published resources, i.e.
Steps To Reproduce
Expected Behaviour
The defaultNaming of local object works even for cluster-scoped published resources.
Additional Context
related source line:
https://github.com/kcp-dev/api-syncagent/blob/main/internal/sync/templating/naming.go#L53