Skip to content

Commit 9cd5bde

Browse files
committed
review
1 parent 6a5f47f commit 9cd5bde

File tree

9 files changed

+120
-561
lines changed

9 files changed

+120
-561
lines changed

apis/v1/gateway_types.go

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,21 @@ type GatewaySpec struct {
298298

299299
// TLSConfigs stores TLS configurations for a Gateway.
300300
//
301-
// GatewayTLSConfigs will impact all existing and newly added Listeners.
301+
// - If the `port` field in `TLSConfig` is not set, the TLS configuration applies
302+
// to all listeners in the gateway. We call this `default` configuration.
303+
// - If the `port` field in `TLSConfig` is set, the TLS configuration applies
304+
// only to listeners with a matching port. Each port requires a unique TLS configuration.
305+
// - Per-port configurations can override the `default` configuration.
306+
// - The `default` configuration is optional. Clients can apply TLS configuration
307+
// to a subset of listeners by creating only per-port configurations.
308+
// Listeners with a port that does not match any TLS configuration will
309+
// not have `frontendValidation` set.
302310
//
303311
// Support: Core
304-
//
305312
// +optional
306-
TLSConfigs GatewayTLSConfigs `json:"tlsConfigs,omitempty"`
313+
//
314+
// <gateway:experimental>
315+
TLSConfigs []TLSConfig `json:"tlsConfigs,omitempty"`
307316
}
308317

309318
// AllowedListeners defines which ListenerSets can be attached to this Gateway.
@@ -423,7 +432,7 @@ type Listener struct {
423432
// the Protocol field is "HTTPS" or "TLS". It is invalid to set this field
424433
// if the Protocol field is "HTTP", "TCP", or "UDP".
425434
//
426-
// The association of SNIs to Certificate defined in GatewayTLSConfig is
435+
// The association of SNIs to Certificate defined in ListenerTLSConfig is
427436
// defined based on the Hostname field for this listener.
428437
//
429438
// The GatewayClass MUST use the longest matching SNI out of all
@@ -432,7 +441,7 @@ type Listener struct {
432441
// Support: Core
433442
//
434443
// +optional
435-
TLS *GatewayTLSConfig `json:"tls,omitempty"`
444+
TLS *ListenerTLSConfig `json:"tls,omitempty"`
436445

437446
// AllowedRoutes defines the types of routes that MAY be attached to a
438447
// Listener and the trusted namespaces where those Route resources MAY be
@@ -535,10 +544,10 @@ type GatewayBackendTLS struct {
535544
ClientCertificateRef *SecretObjectReference `json:"clientCertificateRef,omitempty"`
536545
}
537546

538-
// GatewayTLSConfig describes a TLS configuration.
547+
// ListenerTLSConfig describes a TLS configuration for a listener.
539548
//
540549
// +kubebuilder:validation:XValidation:message="certificateRefs or options must be specified when mode is Terminate",rule="self.mode == 'Terminate' ? size(self.certificateRefs) > 0 || size(self.options) > 0 : true"
541-
type GatewayTLSConfig struct {
550+
type ListenerTLSConfig struct {
542551
// Mode defines the TLS behavior for the TLS session initiated by the client.
543552
// There are two possible modes:
544553
//
@@ -587,17 +596,6 @@ type GatewayTLSConfig struct {
587596
// +kubebuilder:validation:MaxItems=64
588597
CertificateRefs []SecretObjectReference `json:"certificateRefs,omitempty"`
589598

590-
// FrontendValidation holds configuration information for validating the frontend (client).
591-
// Setting this field will result in mutual authentication when connecting to the gateway. In browsers this may result in a dialog appearing
592-
// that requests a user to specify the client certificate.
593-
// The maximum depth of a certificate chain accepted in verification is Implementation specific.
594-
//
595-
// Support: Extended
596-
//
597-
// +optional
598-
// <gateway:experimental>
599-
FrontendValidation *FrontendTLSValidation `json:"frontendValidation,omitempty"`
600-
601599
// Options are a list of key/value pairs to enable extended TLS
602600
// configuration for each implementation. For example, configuring the
603601
// minimum TLS version or supported cipher suites.
@@ -644,6 +642,7 @@ type TLSConfig struct {
644642
// +optional
645643
// <gateway:experimental>
646644
Port *PortNumber `json:"port,omitempty"`
645+
//
647646
// FrontendValidation holds configuration information for validating the frontend (client).
648647
// Setting this field will result in mutual authentication when connecting to the gateway.
649648
// In browsers this may result in a dialog appearing
@@ -706,19 +705,6 @@ type FrontendTLSValidation struct {
706705
Mode FrontendValidationModeType `json:"mode,omitempty"`
707706
}
708707

709-
// GatewayTLSConfigs stores TLS configurations for a Gateway.
710-
//
711-
// - If the `port` field in `TLSConfig` is not set, the TLS configuration applies
712-
// to all listeners in the gateway. We call this `default` configuration.
713-
// - If the `port` field in `TLSConfig` is set, the TLS configuration applies
714-
// only to listeners with a matching port. Each port requires a unique TLS configuration.
715-
// - Per-port configurations can override the `default` configuration.
716-
// - The `default` configuration is optional. Clients can apply TLS configuration
717-
// to a subset of listeners by creating only per-port configurations.
718-
// Listeners with a port that does not match any TLS configuration will
719-
// not have `frontendValidation` set.
720-
type GatewayTLSConfigs []TLSConfig
721-
722708
// FrontendValidationModeType type defines how a Gateway validates client certificates.
723709
//
724710
// +kubebuilder:validation:Enum=AllowValidOnly;AllowInvalidOrMissingCert

apis/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfiguration/apis/v1/gatewayspec.go

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfiguration/apis/v1/tlsconfig.go

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)