bug: default naming for local object fails on cluster-scoped published resources
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start at internal/sync/templating/naming.go around line 53 and reproduce the failure with a cluster-scoped PublishedResource using the default naming scheme. Trace how the namespace value is passed to sha3short, then verify that local object names are generated successfully for cluster-scoped published resources while the documented workaround remains unnecessary.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Go
- Stars
- 25
- Forks
- 30
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kcp-dev/api-syncagent
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kcp-dev/api-syncagent#161 ·
-
kind/feature
Difficulty 4/5 3-5 days Newbie friendliness 48/100
kcp-dev/api-syncagent#186 · 1 reaction ·
-
kind/bug
kcp-dev/api-syncagent#182 · 1 comment · 1 assignee ·
-
bug: finalizer "syncagent.kcp.io/cleanup" on related resources block deletion of primary object Openkind/bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
kcp-dev/api-syncagent#172 · 1 comment · 1 reaction ·
-
kind/feature
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
kcp-dev/api-syncagent#157 ·
All issues in kcp-dev/api-syncagent
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·