Skip to content

Commit

Permalink
fix: Remove pattern and min length validation from ModuleTemplate spe…
Browse files Browse the repository at this point in the history
…c.channel (#2018)

* Remove pattern and min length validation from ModuleTemplate spec.channel to allow nullable channels

* fix test

* re add new validation pattern

* re add test
  • Loading branch information
nesmabadr authored Nov 8, 2024
1 parent 43c06f9 commit 6dbccc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions api/v1beta1/moduletemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ type ModuleTemplateSpec struct {
// Deprecated: This field is deprecated and will be removed in a future release.
// +optional
// +kubebuilder:deprecatedversion
// +kubebuilder:validation:Pattern:=^[a-z]+$
// +kubebuilder:validation:Pattern:=`^$|^[a-z]{3,}$`
// +kubebuilder:validation:MaxLength:=32
// +kubebuilder:validation:MinLength:=3
Channel string `json:"channel"`

// Mandatory indicates whether the module is mandatory. It is used to enforce the installation of the module with
Expand Down
3 changes: 1 addition & 2 deletions api/v1beta2/moduletemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ type ModuleTemplateSpec struct {
// Deprecated: This field is deprecated and will be removed in a future release.
// +optional
// +kubebuilder:deprecatedversion
// +kubebuilder:validation:Pattern:=^[a-z]+$
// +kubebuilder:validation:Pattern:=`^$|^[a-z]{3,}$`
// +kubebuilder:validation:MaxLength:=32
// +kubebuilder:validation:MinLength:=3
Channel string `json:"channel"`

// Version identifies the version of the Module. Can be empty, or a semantic version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ spec:
to a target channel. It has to be provided at any given time.
Deprecated: This field is deprecated and will be removed in a future release.
maxLength: 32
minLength: 3
pattern: ^[a-z]+$
pattern: ^$|^[a-z]{3,}$
type: string
customStateCheck:
items:
Expand Down Expand Up @@ -182,8 +181,7 @@ spec:
to a target channel. It has to be provided at any given time.
Deprecated: This field is deprecated and will be removed in a future release.
maxLength: 32
minLength: 3
pattern: ^[a-z]+$
pattern: ^$|^[a-z]{3,}$
type: string
customStateCheck:
description: CustomStateCheck is deprecated.
Expand Down

0 comments on commit 6dbccc9

Please sign in to comment.