You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v1alpha1/backend_types.go
+20-3Lines changed: 20 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,8 @@ type UnixSocket struct {
132
132
133
133
// BackendSpec describes the desired state of BackendSpec.
134
134
// +kubebuilder:validation:XValidation:rule="self.type != 'DynamicResolver' || !has(self.endpoints)",message="DynamicResolver type cannot have endpoints specified"
135
+
// +kubebuilder:validation:XValidation:rule="self.type != 'DynamicResolver' || !has(self.tls) || !(has(self.tls.autoSNIFromEndpointHostname) && self.tls.autoSNIFromEndpointHostname)",message="DynamicResolver type cannot use autoSNIFromEndpointHostname"
136
+
// +kubebuilder:validation:XValidation:rule="!has(self.tls) || !(has(self.tls.autoSNIFromEndpointHostname) && self.tls.autoSNIFromEndpointHostname) || self.endpoints.all(e, (!has(e.ip) && !has(e.unix)) || has(e.hostname))",message="when autoSNIFromEndpointHostname is enabled, IP and Unix endpoints must define a hostname"
135
137
typeBackendSpecstruct {
136
138
// Type defines the type of the backend. Defaults to "Endpoints"
137
139
//
@@ -173,6 +175,7 @@ type BackendSpec struct {
173
175
// BackendTLSSettings holds the TLS settings for the backend.
174
176
// +kubebuilder:validation:XValidation:message="must not contain both CACertificateRefs and WellKnownCACertificates",rule="!(has(self.caCertificateRefs) && size(self.caCertificateRefs) > 0 && has(self.wellKnownCACertificates) && self.wellKnownCACertificates != \"\")"
175
177
// +kubebuilder:validation:XValidation:message="must not contain either CACertificateRefs or WellKnownCACertificates when InsecureSkipVerify is enabled",rule="!((has(self.insecureSkipVerify) && self.insecureSkipVerify) && ((has(self.caCertificateRefs) && size(self.caCertificateRefs) > 0) || (has(self.wellKnownCACertificates) && self.wellKnownCACertificates != \"\")))"
178
+
// +kubebuilder:validation:XValidation:message="sni and autoSNIFromEndpointHostname are mutually exclusive",rule="!(has(self.sni) && has(self.autoSNIFromEndpointHostname) && self.autoSNIFromEndpointHostname)"
176
179
typeBackendTLSSettingsstruct {
177
180
// CACertificateRefs contains one or more references to Kubernetes objects that
178
181
// contain TLS certificates of the Certificate Authorities that can be used
@@ -206,18 +209,32 @@ type BackendTLSSettings struct {
ifbtpValidationTLSConfig.SNI!=nil {// BTP takes precedence for SNI, if set, it will override Backend resource SNI and disable AutoSNIFromEndpointHostname
0 commit comments