-
Notifications
You must be signed in to change notification settings - Fork 84
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 lowercase regex validation for vpc, vpcsubnet and loadbalancer names #1715
Conversation
Hi @Shilpa-Gokul. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/ok-to-test |
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.
These changes LGTM,
If possible it would be great if you can cover other services as well including PowerVS
- Workspace name
2.DHCP Server name - Cos Instance name
4.Transitgateway name
otherwise we can merge this. After @Prajyot-Parab review.
@Shilpa-Gokul lets take care of other services as well, as suggested by karthik. |
@Karthik-K-N @Prajyot-Parab Done, I have added the check for other services as well, PTAL |
@@ -243,6 +245,8 @@ type IBMPowerVSClusterList struct { | |||
// TransitGateway holds the TransitGateway information. | |||
type TransitGateway struct { | |||
// name of resource. | |||
// +kubebuilder:validation:MaxLength:=63 | |||
// +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$` |
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.
Did you manually verified from UI this before adding the check?
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.
Here is the reference https://cloud.ibm.com/apidocs/transit-gateway#create-transit-gateway, It does support capital letters
@@ -146,6 +146,8 @@ type IBMPowerVSResourceReference struct { | |||
|
|||
// Name of resource | |||
// +kubebuilder:validation:MinLength=1 | |||
// +kubebuilder:validation:MaxLength:=63 |
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.
@Shilpa-Gokul, can you share why pattern validation was added to IBMPowerVSResourceReference
? ResourceGroup
is of type IBMPowerVSResourceReference
and I see that is supports camel case and capital letters in case user specifies it.
Would it maybe be possible to add to the specific resource than adding it here?
Validations added are as mentioned below
@Karthik-K-N / @Amulyam24 could you please review this once? |
Thank you |
Thank you for verifying @Shilpa-Gokul! /lgtm /cc @Prajyot-Parab |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Prajyot-Parab, Shilpa-Gokul 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 |
What this PR does / why we need it:
vpc, vpcSubnets, loadbalancer, cosInstance names doesn't seem to support camelCase, so added kubebuilder tag to validate if it contains only lowercase alphanumeric characters. Added validation to check if transitgateway names supports camelCase.
Validation output is as follows.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1659
Special notes for your reviewer:
/area provider/ibmcloud
Release note: