Skip to content

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Sep 29, 2025

All the changes from #74 that are not directly related to sharding. To make it easier to review.

Signed-off-by: Dr. Stefan Schimanski <[email protected]>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 29, 2025
@k8s-ci-robot k8s-ci-robot requested review from embik and skitt September 29, 2025 08:12
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 29, 2025
@sttts sttts changed the title Prefactoring: controller-sharding 🌱 Prefactoring: controller-sharding Sep 29, 2025
@k8s-ci-robot
Copy link
Contributor

@zachsmith1: changing LGTM is restricted to collaborators

In response to this:

Instructions 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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts, zachsmith1

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

return nil
// Check if we already have this cluster engaged with the SAME context
if old, ok := c.clusters[name]; ok {
if old.cluster == cl && old.ctx.Err() == nil {
Copy link
Member

Choose a reason for hiding this comment

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

this might be a bit of a stupid Go question, but this comparison will fail when the pointer backing the interface points to a different object, right? Should we be concerned that providers might construct cluster objects on the fly and could depend on names being equal to stop replacing an existing cluster?

Choose a reason for hiding this comment

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

yes—interface equality on a pointer-backed cluster compares pointer identity, so a new instance for the same name won’t equal the old one; that’s intentional because a new instance usually means kubeconfig/impl changed and we should re-engage. if a provider churns instances but is semantically the same, we can relax by also checking a stable handle (e.g., cl.GetCache()) or document that providers should return a stable instance per name unless they intend a reattach.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, I think this is a valid assumption. I wonder if we should document this explicitly though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Dr. Stefan Schimanski <[email protected]>
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants