Skip to content

Commit

Permalink
Revert the regex validation for tg,serviceinstance etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Shilpa-Gokul committed Apr 10, 2024
1 parent 68cc970 commit 4a6868b
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 37 deletions.
7 changes: 4 additions & 3 deletions api/v1beta2/ibmpowervscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ type DHCPServer struct {
DNSServer *string `json:"dnsServer,omitempty"`

// Optional name of DHCP Service. Only alphanumeric characters and dashes are allowed.
// +kubebuilder:validation:MaxLength:=63
// +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`
Name *string `json:"name,omitempty"`

// Optional id of the existing DHCPServer
Expand Down Expand Up @@ -245,8 +243,9 @@ type IBMPowerVSClusterList struct {
// TransitGateway holds the TransitGateway information.
type TransitGateway struct {
// name of resource.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength:=63
// +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`
// +kubebuilder:validation:Pattern=`^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$`
// +optional
Name *string `json:"name,omitempty"`
// id of resource.
Expand All @@ -260,6 +259,8 @@ type TransitGateway struct {
type VPCResourceReference struct {
// id of resource.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength:=64
// +kubebuilder:validation:Pattern=`^[-0-9a-z_]+$`
// +optional
ID *string `json:"id,omitempty"`

Expand Down
2 changes: 0 additions & 2 deletions api/v1beta2/ibmpowervsmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ type IBMPowerVSResourceReference struct {

// Name of resource
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength:=63
// +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`
// +optional
Name *string `json:"name,omitempty"`

Expand Down
4 changes: 4 additions & 0 deletions api/v1beta2/ibmvpccluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ type IBMVPCClusterSpec struct {
// VPCLoadBalancerSpec defines the desired state of an VPC load balancer.
type VPCLoadBalancerSpec struct {
// Name sets the name of the VPC load balancer.
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MaxLength:=63
// +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`
// +optional
Name string `json:"name,omitempty"`

// id of the loadbalancer
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength:=64
// +kubebuilder:validation:Pattern=`^[-0-9a-z_]+$`
// +optional
ID *string `json:"id,omitempty"`

Expand Down
4 changes: 4 additions & 0 deletions api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,13 @@ type SecurityGroupRulePrototype struct {
// Subnet describes a subnet.
type Subnet struct {
Ipv4CidrBlock *string `json:"cidr,omitempty"`
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength:=63
// +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`
Name *string `json:"name,omitempty"`
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength:=64
// +kubebuilder:validation:Pattern=`^[-0-9a-z_]+$`
ID *string `json:"id,omitempty"`
Zone *string `json:"zone,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ spec:
name:
description: Optional name of DHCP Service. Only alphanumeric
characters and dashes are allowed.
maxLength: 63
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
snat:
default: true
Expand Down Expand Up @@ -292,10 +290,14 @@ spec:
x-kubernetes-list-type: map
id:
description: id of the loadbalancer
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
description: Name sets the name of the VPC load balancer.
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
public:
Expand All @@ -322,9 +324,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand All @@ -346,9 +346,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -376,9 +374,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -406,7 +402,8 @@ spec:
name:
description: name of resource.
maxLength: 63
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
minLength: 1
pattern: ^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$
type: string
type: object
vpc:
Expand All @@ -420,7 +417,9 @@ spec:
properties:
id:
description: id of resource.
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
description: name of resource.
Expand Down Expand Up @@ -450,9 +449,13 @@ spec:
cidr:
type: string
id:
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
zone:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ spec:
name:
description: Optional name of DHCP Service. Only alphanumeric
characters and dashes are allowed.
maxLength: 63
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
snat:
default: true
Expand Down Expand Up @@ -323,10 +321,14 @@ spec:
x-kubernetes-list-type: map
id:
description: id of the loadbalancer
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
description: Name sets the name of the VPC load balancer.
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
public:
Expand All @@ -353,9 +355,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand All @@ -377,9 +377,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -407,9 +405,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -437,7 +433,8 @@ spec:
name:
description: name of resource.
maxLength: 63
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
minLength: 1
pattern: ^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$
type: string
type: object
vpc:
Expand All @@ -451,7 +448,9 @@ spec:
properties:
id:
description: id of resource.
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
description: name of resource.
Expand Down Expand Up @@ -481,9 +480,13 @@ spec:
cidr:
type: string
id:
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
zone:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -409,9 +407,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -474,9 +470,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -252,9 +250,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down Expand Up @@ -317,9 +313,7 @@ spec:
type: string
name:
description: Name of resource
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
regex:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,14 @@ spec:
x-kubernetes-list-type: map
id:
description: id of the loadbalancer
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
description: Name sets the name of the VPC load balancer.
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
public:
Expand Down Expand Up @@ -365,9 +369,13 @@ spec:
cidr:
type: string
id:
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
zone:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ spec:
x-kubernetes-list-type: map
id:
description: id of the loadbalancer
maxLength: 64
minLength: 1
pattern: ^[-0-9a-z_]+$
type: string
name:
description: Name sets the name of the VPC load balancer.
maxLength: 63
minLength: 1
pattern: ^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$
type: string
public:
Expand Down

0 comments on commit 4a6868b

Please sign in to comment.