Skip to content

⚠ Replace clusterName string parameter with the explicit type multicluster.ClusterName#133

Merged
k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
ntnn:typed-clusterName
Feb 18, 2026
Merged

⚠ Replace clusterName string parameter with the explicit type multicluster.ClusterName#133
k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
ntnn:typed-clusterName

Conversation

@ntnn

@ntnn ntnn commented Feb 17, 2026

Copy link
Copy Markdown
Member

Typing an identifier has many benefits. It avoids passing the wrong variable at the wrong place, it aids in readability (e.g. we have many places where a cluster name is just referred to as key - finding out that it is a cluster name then needs some digging, especially when the helper functions that generated the data being iterated over is also very named very nondescript), etcpp

@k8s-ci-robot k8s-ci-robot added 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. labels Feb 17, 2026
@ntnn ntnn force-pushed the typed-clusterName branch from 4fad430 to e36d12f Compare February 17, 2026 18:21
@embik

embik commented Feb 18, 2026

Copy link
Copy Markdown
Member

I feel like we had this before, but that was maybe with a generic. @sttts any objections to this?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2026
@sttts

sttts commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

A string wrapper type I can see. I was always against making the cluster name generic, i.e. with a type parameter. I tried that once on a branch and it was awful in usability. But this type ClusterName string is fine.

@ntnn

ntnn commented Feb 18, 2026

Copy link
Copy Markdown
Member Author

I feel like we had this before, but that was maybe with a generic. @sttts any objections to this?

Seems like it: #2

Personally I'm more a fan of strong typing identifiers and using generics to support similar types rather than different identifiers.

Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
@embik

embik commented Feb 18, 2026

Copy link
Copy Markdown
Member

Okay, sounds good. Since the PR title is the release note in this project, can we maybe make it more descriptive? Something that says "Replace clusterName string parameter for providers with multicluster.ClusterName"?

@ntnn ntnn changed the title ⚠ Add multicluster.ClusterName, a typed cluster name ⚠ Replace clusterName string parameter with the explicit type multicluster.ClusterName Feb 18, 2026
Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
@ntnn ntnn force-pushed the typed-clusterName branch from e36d12f to 840e933 Compare February 18, 2026 08:30
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2026

@embik embik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve

off we go 🚀

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 18, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: aea305e1a3767c7fd9899c2d984c257d744c8277

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: embik, ntnn

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

The pull request process is described here

Details 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2026
@k8s-ci-robot k8s-ci-robot merged commit 1df3cff into kubernetes-sigs:main Feb 18, 2026
21 checks passed
@ntnn ntnn deleted the typed-clusterName branch February 18, 2026 08:46
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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