Skip to content

Conversation

xrstf
Copy link
Contributor

@xrstf xrstf commented Feb 4, 2025

Summary

If two or more Sync Agents work on the same local cluster (but each talking to its own kcp), and they both serve the same local API (i.e. there are 2 PublishedResources that describe the same local API), they will get confused over each other's objects. When Agent 1 syncs an object from kcp 1 to the local cluster, Agent 2 might think it own it. The severity of this issue also depends on object naming (if for example the kcp cluster names are included in the local object names, for example as namespaces, then a collision is less likely since cluster names should be globally unique).

To improve the situation, this PR uses the already existing agent name to label local objects, declaring ownership over them. This does not mean 2 PublishedResources can now lead to conflicts (object A in kcp 1 and object B in kcp 2 both getting synced down into the same local object), that is still forbidden. This PR is more about preventing accidental overlaps, where the Agent by accident reconciles the wrong objects.

Related issue(s)

Fixes #13

Release Notes

Label local objects with the agent name

@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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 4, 2025
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 Feb 5, 2025
@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e8e8f77529a01c138a29945b24e9c3220a42d113

@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 kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2025
@kcp-ci-bot kcp-ci-bot merged commit 491adf3 into main Feb 5, 2025
10 checks passed
@kcp-ci-bot kcp-ci-bot deleted the label-agent-name branch February 5, 2025 14:38
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Connect the same API on multiple kcp's to the same service cluster

3 participants