Skip to content

Conversation

@xrstf
Copy link
Contributor

@xrstf xrstf commented Mar 12, 2025

Summary

Objects in Kubernetes can have names up to 253 characters in length. However label values must not be longer than 63 characters. Since the agent uses the remote (kcp) name/namespace as labels, the syncing failed when objects with names longer than 63 characters were in kcp.

This PR fixes that by hashing the namespace/name and storing the original names, for reference, as annotations instead. The same issue affected the secret store, because keys in a secret's data must also not be overly long, so the agent now uses hashes for these as well.

Existing synced objects will not be found under this new implementation, but the agent will already automatically "adopt" existing objects and re-label/annotate them as needed. The data in the store secrets will also be recreated, so effectively every object is fully re-created on the service cluster side, potentially undoing changes from operators. Good thing this is alpha software 😁

Related issue(s)

Fixes #34

Release Notes

Fix syncing errors when object names/namespaces in kcp exceeded 63 characters in length.

@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 12, 2025
@xrstf xrstf requested a review from embik March 12, 2025 17:26
Copy link
Member

@embik embik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 13, 2025
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: embik

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 02dda869bc51d195ae9de1c7ad8a5730678172c6

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 13, 2025
@kcp-ci-bot kcp-ci-bot merged commit 187fa93 into main Mar 13, 2025
11 checks passed
@kcp-ci-bot kcp-ci-bot deleted the handle-long-names branch March 13, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: cannot handle objects in kcp with extremely long names

3 participants