Skip to content

Switching from comparison on Role to helper. - #18514

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
cheftako:has_methods
Jun 27, 2026
Merged

Switching from comparison on Role to helper.#18514
kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
cheftako:has_methods

Conversation

@cheftako

Copy link
Copy Markdown
Member

Preperation for something like #18495.
Moving away from direct comparison (== or !=) on IG role. Using helper methods such as HasNode() or HasControlPlane(). Also added a hack test so we don't backtrack.
Should help prepare for supporting more control plane roles.

Preperation for something like kubernetes#18495.
Moving away from direct comparison (== or !=) on IG role.
Using helper methods such as HasNode() or HasControlPlane().
Also added a hack test so we don't backtrack.
Should help prepare for supporting more control plane roles.
@cheftako

Copy link
Copy Markdown
Member Author

/assign @justinsb

@kubernetes-prow kubernetes-prow Bot 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 Jun 26, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from hakman June 26, 2026 19:54
@kubernetes-prow
kubernetes-prow Bot requested a review from zetaab June 26, 2026 19:54
@kubernetes-prow kubernetes-prow Bot added area/nodeup area/provider/aws Issues or PRs related to aws provider area/provider/azure Issues or PRs related to azure provider area/provider/digitalocean Issues or PRs related to digitalocean provider area/provider/gcp Issues or PRs related to gcp provider area/provider/openstack Issues or PRs related to openstack provider area/provider/spotinst Issues or PRs related to spotinst provider area/rolling-update labels Jun 26, 2026
@cheftako

Copy link
Copy Markdown
Member Author

/assign @hakman

@cheftako

Copy link
Copy Markdown
Member Author

/test pull-kops-e2e-azure-cni-cilium


errors=0

# Find all .go files, excluding vendor, .build, and the file where roles are defined.

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.

Oooh I like this tactic. We should think about how we do this in general e.g. do these get deleted after a while? Should they actually only be in the PR description (e.g. if we had a variable rename, then we could automatically verify that the commit just did a variable rename).

Anyway, I like this, it sets up some interesting questions, but we don't need to deal with them in this PR - let's explore the idea a bit more first before trying to systematize it!

@justinsb justinsb 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
/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 27, 2026
@justinsb

Copy link
Copy Markdown
Member

Very nice - much cleaner, and the idea of including the "macros" is really interesting.

I think the test failure is a flake:

/test pull-kops-e2e-azure-cni-cilium

/approve
/lgtm

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 27, 2026
@hakman

hakman commented Jun 27, 2026

Copy link
Copy Markdown
Member

/test all

@kubernetes-prow
kubernetes-prow Bot merged commit 0598fb7 into kubernetes:master Jun 27, 2026
34 checks passed
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. area/api area/nodeup area/provider/aws Issues or PRs related to aws provider area/provider/azure Issues or PRs related to azure provider area/provider/digitalocean Issues or PRs related to digitalocean provider area/provider/gcp Issues or PRs related to gcp provider area/provider/openstack Issues or PRs related to openstack provider area/provider/spotinst Issues or PRs related to spotinst provider area/rolling-update 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.

3 participants