Skip to content

Commit

Permalink
crd: add minItems for hosts
Browse files Browse the repository at this point in the history
The hosts field is not required but it should have
at least one item when specified.

Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov committed Mar 11, 2024
1 parent 7f40e76 commit e54e727
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions apis/zalando.org/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type RouteGroupList struct {
// +k8s:deepcopy-gen=true
type RouteGroupSpec struct {
// List of hostnames for the RouteGroup
// +kubebuilder:validation:MinItems=1
Hosts []string `json:"hosts,omitempty"`
// List of backends that can be referenced in the routes
Backends []RouteGroupBackend `json:"backends"`
Expand Down
1 change: 1 addition & 0 deletions zalando.org_routegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ spec:
items:
pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
type: string
minItems: 1
type: array
routes:
description: Routes describe how a matching HTTP request is handled
Expand Down

0 comments on commit e54e727

Please sign in to comment.