Repository navigation
Use a default local name that works for cluster-scoped objects - #192
Sarthak-Shreshtha01 wants to merge 1 commit into
Conversation
The default name template hashes .Object.metadata.namespace, which is missing on cluster-scoped objects, so sha3short failed and the local object was never created. For objects without a namespace the default name now hashes the cluster name instead, which also keeps names unique when the local copy is cluster-scoped and the namespace is dropped. Signed-off-by: Sarthak <sarthakshreshtha345@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Sarthak-Shreshtha01. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
The default local name is
{{ .Object.metadata.namespace | sha3short }}-{{ .Object.metadata.name | sha3short }}. Cluster-scoped objects have no namespace, sosha3shortgets no string, the template fails, and the local object is never created.For objects without a namespace, the default name is now
{{ .ClusterName | sha3short }}-{{ .Object.metadata.name | sha3short }}. Using the cluster name keeps names unique even when the local copy is cluster-scoped too, since then the{{ .ClusterName }}namespace is dropped. Names of namespaced objects do not change. The API comment, the generated CRD and the docs mention the new default.What Type of PR Is This?
/kind bug
Related Issue(s)
Fixes #163
Release Notes