diff --git a/apis/v1alpha3/tlsroute_types.go b/apis/v1alpha3/tlsroute_types.go index 7bcb48e74b..60e2dc7b99 100644 --- a/apis/v1alpha3/tlsroute_types.go +++ b/apis/v1alpha3/tlsroute_types.go @@ -86,6 +86,7 @@ type TLSRouteSpec struct { // // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=16 + // +required Hostnames []Hostname `json:"hostnames,omitempty"` // Rules are a list of TLS matchers and actions. diff --git a/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml b/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml index 4392eff57f..923fa49ba5 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml @@ -1277,6 +1277,7 @@ spec: rule: self.all(l1, !has(l1.name) || self.exists_one(l2, has(l2.name) && l1.name == l2.name)) required: + - hostnames - rules type: object status: diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index b26723bcec..7dcbaa33b6 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -7321,7 +7321,7 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha3_TLSRouteSpec(ref common.Referenc }, }, }, - Required: []string{"rules"}, + Required: []string{"hostnames", "rules"}, }, }, Dependencies: []string{