Skip to content

Commit

Permalink
crd: require unique hosts
Browse files Browse the repository at this point in the history
Example validation message:
```
Error from server (Invalid): error when creating "rg.yaml": RouteGroup.zalando.org "duplicate-hosts" is invalid: spec.hosts[1]: Duplicate value: "foo.example.org"
```

Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov committed Mar 27, 2024
1 parent 5c0ecfd commit af6dccf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 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 @@ -43,6 +43,7 @@ type RouteGroupList struct {
type RouteGroupSpec struct {
// List of hostnames for the RouteGroup
// +kubebuilder:validation:MinItems=1
// +listType=set
Hosts []string `json:"hosts,omitempty"`
// List of backends that can be referenced in the routes
Backends []RouteGroupBackend `json:"backends"`
Expand Down
6 changes: 0 additions & 6 deletions client/clientset/versioned/doc.go

This file was deleted.

1 change: 1 addition & 0 deletions zalando.org_routegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ spec:
type: string
minItems: 1
type: array
x-kubernetes-list-type: set
routes:
description: Routes describe how a matching HTTP request is handled
and where it is forwarded to
Expand Down

0 comments on commit af6dccf

Please sign in to comment.