-
Notifications
You must be signed in to change notification settings - Fork 585
Add loadbalancer field to Power VS machine provider spec #1415
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 loadbalancer field to Power VS machine provider spec #1415
Conversation
|
Hello @Karthik-K-N! Some important instructions when contributing to openshift/api: |
d276e1b to
52a9759
Compare
|
@mkumatag @JoelSpeed could you please take a look and help in reviewing this. |
c55273d to
bf2a83b
Compare
machine/v1/types_powervsprovider.go
Outdated
| // Name of the LoadBalancer in IBM Cloud VPC | ||
| // It is a reference to existing LoadBalancer created by openshift installer component. | ||
| // +kubebuilder:validation:Required | ||
| Name string `json:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should start with the json tag name not the Go field name, is there any way to restrict this? For example can we explain what character set, minimum/maximum lengths are required for this field?
| // Name of the LoadBalancer in IBM Cloud VPC | |
| // It is a reference to existing LoadBalancer created by openshift installer component. | |
| // +kubebuilder:validation:Required | |
| Name string `json:"name"` | |
| // name of the LoadBalancer in IBM Cloud VPC | |
| // It is a reference to existing LoadBalancer created by openshift installer component. | |
| // +kubebuilder:validation:Required | |
| Name string `json:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure , not sure how can we restrict it, Currently the loadbalancer name will be of format "{cluster-id}-loadbalancer" for public and "{cluster-id}-loadbalancer-int" for internal loadbalancer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is cluster-id restricted at all by the installer? We can probably restrict this to alphanumeric characters, hyphens and underscores, but we should check what restrictions are imposed by the installer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies we are using infraID not clusterid, Infra ID is generated like this: https://github.com/Karthik-K-N/installer/blob/e91df626c10e569e7613249053b7b9b264db42df/pkg/asset/installconfig/clusterid.go#L60-L79
I think we can add validation for alphanumeric with hyphen,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looks like it can be limited to alphanum and hyphen, great!
machine/v1/types_powervsprovider.go
Outdated
| // Currently only Application LoadBalancer is supported | ||
| // More details about Application LoadBalancer | ||
| // https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers-about&interface=ui |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Currently only Application LoadBalancer is supported | |
| // More details about Application LoadBalancer | |
| // https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers-about&interface=ui | |
| // Currently only the Application LoadBalancer is supported. | |
| // More details about Application LoadBalancer | |
| // https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers-about&interface=ui. | |
| // Supported values are Application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
bf2a83b to
e3face4
Compare
| // name of the LoadBalancer in IBM Cloud VPC. | ||
| // It is a reference to existing LoadBalancer created by openshift installer component. | ||
| // +kubebuilder:validation:Required | ||
| Name string `json:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a kubebuilder validation for the alpha numeric characters and hyphen, then we will want to explain this limitation within the godoc, and also, we should probably set a maximum length, is there anything in IBM that limits the length or the characters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the following in the docs, how wil we handle this? Convert any hyphen to an underscore internally? How will we limit the name length given the infra-id may be 27 characters, any thoughts?
Names may not be empty. A valid load balancer name starts with a letter, followed by letters, digits, or underscores. The length of the name may not exceed 40 characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loadbalancer name may contain hyphens, Currently this is how the installer creates the loadbalancer rdr-kn08031125-vhwtg-loadbalancer.
From api doc I can see this description for name
The globally unique name for this load balancer profile
Possible values: 1 ≤ length ≤ 63, Value must match regular expression ^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$
Example: network-fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for finding that, can you explain this in prose within the godoc please? We need to say something along the lines of
// The name should be between 1 and 63 characters long and may consist of lowercase alphanumeric characters and hyphens only.
// The value must not end with a hyphen and integer values are not allowed.
I think I've understood that regex correctly anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can just add a touch more documentation to this name field as per my suggestion I think this is good to go
Updated accordingly, Please take a look. Thank you.
846eb18 to
4c5aebe
Compare
JoelSpeed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can just add a touch more documentation to this name field as per my suggestion I think this is good to go
| // name of the LoadBalancer in IBM Cloud VPC. | ||
| // It is a reference to existing LoadBalancer created by openshift installer component. | ||
| // +kubebuilder:validation:Required | ||
| Name string `json:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for finding that, can you explain this in prose within the godoc please? We need to say something along the lines of
// The name should be between 1 and 63 characters long and may consist of lowercase alphanumeric characters and hyphens only.
// The value must not end with a hyphen and integer values are not allowed.
I think I've understood that regex correctly anyway
4c5aebe to
01b3eab
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed, Karthik-K-N The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@Karthik-K-N: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
This PR adds LoadBalancers filed to Power VS spec.
Usage: