Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "cluster" type to subnet role validation #5133

Merged

Conversation

mboersma
Copy link
Contributor

@mboersma mboersma commented Sep 17, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Adds "cluster" to the valid kubebuilder types for a subnet role, as documented. Apparently we had added "all" instead.

// SubnetCluster defines a role that can be used for both Kubernetes control plane node and Kubernetes workload node.
SubnetCluster = SubnetRole(Cluster)

Which issue(s) this PR fixes:
Fixes #5130

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Add "cluster" type to subnet role validation

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 17, 2024
@mboersma mboersma force-pushed the update-subnet-role-validation branch from ba1d03e to 76ce65f Compare September 17, 2024 15:12
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 17, 2024
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.25%. Comparing base (3770549) to head (76ce65f).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5133   +/-   ##
=======================================
  Coverage   51.25%   51.25%           
=======================================
  Files         273      273           
  Lines       24651    24651           
=======================================
+ Hits        12634    12636    +2     
+ Misses      11231    11229    -2     
  Partials      786      786           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mboersma
Copy link
Contributor Author

/cc @nojnhuh @willie-yao

@@ -473,7 +473,7 @@ type SubnetClassSpec struct {
Name string `json:"name"`

// Role defines the subnet role (eg. Node, ControlPlane)
// +kubebuilder:validation:Enum=node;control-plane;bastion;all
// +kubebuilder:validation:Enum=node;control-plane;bastion;cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is something we'd technically have to call a breaking change if all is no longer valid when it was before. Maybe we have more wiggle room here if all was never functional anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought of that--someone may have read the source code to figure out that "all" would pass validation. But AFAICT there is no code that handles SubnetRole("all"), no tests around that, and no constant defined for it, so it was not intentionally functional and didn't act as SubnetCluster is intended to.

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI @LochanRn

Copy link
Contributor

@nojnhuh nojnhuh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 18, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: fe0a3c964423805dd3b51b9fdc4f409070654935

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nojnhuh

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2024
@k8s-ci-robot k8s-ci-robot merged commit d414308 into kubernetes-sigs:main Sep 18, 2024
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Sep 18, 2024
@mboersma
Copy link
Contributor Author

/cherry-pick release-1.16

@k8s-infra-cherrypick-robot

@mboersma: new pull request created: #5134

In response to this:

/cherry-pick release-1.16

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.

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Subnet roles and validation mismatch
4 participants