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
fix: use trim() in CEL rule to reject whitespace-only name for non-Path scopes
Addresses reviewer feedback: the previous rule 'size(self.name) > 0' would
accept names like ' ' which would produce an invalid APISIX variable
'post_arg. '. Using trim() ensures blank-only names are rejected.
The has(self.name) guard is not needed because non-nullable string fields
resolve to "" (zero value) in Kubernetes CEL when omitted, as confirmed
by existing tests.
Copy file name to clipboardExpand all lines: api/v2/apisixroute_types.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -411,7 +411,7 @@ type ApisixRouteAuthenticationLDAPAuth struct {
411
411
}
412
412
413
413
// ApisixRouteHTTPMatchExprSubject describes the subject of a route matching expression.
414
-
// +kubebuilder:validation:XValidation:rule="self.scope == 'Path' || size(self.name) > 0",message="name is required when scope is not Path"
414
+
// +kubebuilder:validation:XValidation:rule="self.scope == 'Path' || size(self.name.trim()) > 0",message="name is required and must not be blank when scope is not Path"
This section describes the types used by the CRDs.
106
+
#### ActiveHealthCheck
107
+
108
+
109
+
ActiveHealthCheck defines the active upstream health check configuration.
110
+
111
+
112
+
113
+
| Field | Description |
114
+
| --- | --- |
115
+
|`type`_string_| Type is the health check type. Can be `http`, `https`, or `tcp`. |
116
+
|`timeout`_[Duration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#duration-v1-meta)_| Timeout sets health check timeout. |
117
+
|`concurrency`_integer_| Concurrency sets the number of targets to be checked at the same time. |
118
+
|`host`_string_| Host sets the upstream host used in the health check request. |
119
+
|`port`_integer_| Port sets the port on the upstream node to probe. |
120
+
|`httpPath`_string_| HTTPPath sets the HTTP path for the probe request. |
121
+
|`strictTLS`_boolean_| StrictTLS controls whether TLS certificate validation is enforced. |
122
+
|`requestHeaders`_string array_| RequestHeaders sets additional HTTP request headers for the probe. |
123
+
|`healthy`_[ActiveHealthCheckHealthy](#activehealthcheckhealthy)_| Healthy configures the thresholds for marking a node healthy. |
124
+
|`unhealthy`_[ActiveHealthCheckUnhealthy](#activehealthcheckunhealthy)_| Unhealthy configures the thresholds for marking a node unhealthy. |
125
+
126
+
127
+
_Appears in:_
128
+
-[HealthCheck](#healthcheck)
129
+
130
+
#### ActiveHealthCheckHealthy
131
+
132
+
133
+
ActiveHealthCheckHealthy defines thresholds for actively marking an upstream node healthy.
134
+
135
+
136
+
137
+
| Field | Description |
138
+
| --- | --- |
139
+
|`httpCodes`_integer array_| HTTPCodes is the list of HTTP status codes considered healthy. |
140
+
|`successes`_integer_| Successes is the number of consecutive successful responses required to mark a node healthy. |
141
+
|`interval`_[Duration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#duration-v1-meta)_| Interval defines the time between health check probes. Minimum is 1s. |
142
+
143
+
144
+
_Appears in:_
145
+
-[ActiveHealthCheck](#activehealthcheck)
146
+
147
+
#### ActiveHealthCheckUnhealthy
148
+
149
+
150
+
ActiveHealthCheckUnhealthy defines thresholds for actively marking an upstream node unhealthy.
151
+
152
+
153
+
154
+
| Field | Description |
155
+
| --- | --- |
156
+
|`httpCodes`_integer array_| HTTPCodes is the list of HTTP status codes considered unhealthy. |
157
+
|`httpFailures`_integer_| HTTPFailures is the number of HTTP failures to mark a node unhealthy. |
158
+
|`tcpFailures`_integer_| TCPFailures is the number of TCP failures to mark a node unhealthy. |
159
+
|`timeout`_integer_| Timeouts is the number of timeouts to mark a node unhealthy. |
160
+
|`interval`_[Duration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#duration-v1-meta)_| Interval defines the time between health check probes. Minimum is 1s. |
161
+
162
+
163
+
_Appears in:_
164
+
-[ActiveHealthCheck](#activehealthcheck)
165
+
106
166
#### AdminKeyAuth
107
167
108
168
@@ -180,6 +240,7 @@ _Appears in:_
180
240
|`timeout`_[Timeout](#timeout)_| Timeout sets the read, send, and connect timeouts to the upstream. |
181
241
|`passHost`_string_| PassHost configures how the host header should be determined when a request is forwarded to the upstream. Default is `pass`. Can be `pass`, `node` or `rewrite`:<br /> • `pass`: preserve the original Host header<br /> • `node`: use the upstream node’s host<br /> • `rewrite`: set to a custom host via `upstreamHost`|
182
242
|`upstreamHost`_[Hostname](#hostname)_| UpstreamHost specifies the host of the Upstream request. Used only if passHost is set to `rewrite`. |
243
+
|`healthCheck`_[HealthCheck](#healthcheck)_| HealthCheck defines active and passive health check configuration for the upstream backends. When configured, APISIX will probe backends (active) or monitor live traffic (passive) to detect and bypass unhealthy nodes. |
183
244
184
245
185
246
_Appears in:_
@@ -344,6 +405,22 @@ HTTPRoutePolicySpec defines the desired state of HTTPRoutePolicy.
344
405
_Appears in:_
345
406
-[HTTPRoutePolicy](#httproutepolicy)
346
407
408
+
#### HealthCheck
409
+
410
+
411
+
HealthCheck defines the active and passive health check configuration for upstream nodes.
412
+
413
+
414
+
415
+
| Field | Description |
416
+
| --- | --- |
417
+
|`active`_[ActiveHealthCheck](#activehealthcheck)_| Active health checks proactively send requests to upstream nodes to determine their availability. |
418
+
|`passive`_[PassiveHealthCheck](#passivehealthcheck)_| Passive health checks evaluate upstream health based on observed traffic (timeouts, errors). |
0 commit comments