Skip to content

Commit

Permalink
fix prefixLength validation pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
bruelea authored and henrybear327 committed Sep 26, 2024
1 parent aa825f3 commit 9ff1212
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/v1/prefixclaim_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type PrefixClaimSpec struct {
ParentPrefix string `json:"parentPrefix"`

//+kubebuilder:validation:Required
//+kubebuilder:validation:Pattern=`^\/[0-9]|[1-9][0-9]|11[0-9]|12[0-8]$`
//+kubebuilder:validation:Pattern=`^\/[0-9]|[1-9][0-9]|1[01][0-9]|12[0-8]$`
//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'prefixLength' is immutable"
PrefixLength string `json:"prefixLength"`

Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/netbox.dev_prefixclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
- message: Field 'parentPrefix' is immutable
rule: self == oldSelf
prefixLength:
pattern: ^\/[0-9]|[1-9][0-9]|11[0-9]|12[0-8]$
pattern: ^\/[0-9]|[1-9][0-9]|1[01][0-9]|12[0-8]$
type: string
x-kubernetes-validations:
- message: Field 'prefixLength' is immutable
Expand Down

0 comments on commit 9ff1212

Please sign in to comment.