Skip to content

Commit 0f4be7c

Browse files
committed
Allow wildcard suffix
1 parent 5183726 commit 0f4be7c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apis/v1/shared_types.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,23 +503,25 @@ type RouteStatus struct {
503503
}
504504

505505
// Hostname is the fully qualified domain name of a network host. This matches
506-
// the RFC 1123 definition of a hostname with 2 notable exceptions:
506+
// the RFC 1123 definition of a hostname with 3 notable exceptions:
507507
//
508508
// 1. IPs are not allowed.
509509
// 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
510510
// label must appear by itself as the first label.
511+
// 3. A hostname may be suffixed with a wildcard label ( `.*`). The wildcard
512+
// label must appear by itself as the last label.
511513
//
512514
// Hostname can be "precise" which is a domain name without the terminating
513515
// dot of a network host (e.g. "foo.example.com") or "wildcard", which is a
514-
// domain name prefixed with a single wildcard label (e.g. `*.example.com`).
516+
// domain name prefixed or suffixed with a single wildcard label (e.g. `*.example.com` or `example.*`).
515517
//
516518
// Note that as per RFC1035 and RFC1123, a *label* must consist of lower case
517519
// alphanumeric characters or '-', and must start and end with an alphanumeric
518520
// character. No other punctuation is allowed.
519521
//
520522
// +kubebuilder:validation:MinLength=1
521523
// +kubebuilder:validation:MaxLength=253
522-
// +kubebuilder:validation:Pattern=`^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
524+
// +kubebuilder:validation:Pattern=`^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\.\*)?$`
523525
type Hostname string
524526

525527
// PreciseHostname is the fully qualified domain name of a network host. This

0 commit comments

Comments
 (0)