Skip to content

Commit 4acf2f6

Browse files
kflynnk8s-ci-robot
authored andcommitted
chore: Review feedback from Shane Utt
Add security notes on the Gateway side Co-authored-by: Shane Utt <[email protected]> Signed-off-by: Flynn <[email protected]>
1 parent d80fa39 commit 4acf2f6

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

apis/v1/gateway_types.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,22 @@ type GatewaySpec struct {
295295
// <gateway:experimental>
296296
TLS *GatewayTLSConfig `json:"tls,omitempty"`
297297

298-
// DefaultScope defines the default scope for this Gateway. If unset or
299-
// set to the empty string `""` (the default), the Gateway will not
300-
// act as a default Gateway; if set, the
301-
// Gateway will claim any Route with a matching scope set in its
302-
// UseDefaultGateway field, subject to the usual rules about which routes
303-
// the Gateway can attach to.
298+
// DefaultScope when set configures the Gateway as a default Gateway, meaning
299+
// it will dynamically and implicitly have Routes (e.g. HTTPRoute) attached
300+
// to it, according to the scope configured here.
301+
//
302+
// If unset or set to the empty string `""` (the default), the Gateway will not
303+
// act as a default Gateway; if set, the Gateway will claim any Route with a
304+
// matching scope set in its UseDefaultGateway field, subject to the usual
305+
// rules about which routes the Gateway can attach to.
306+
//
307+
// Think carefully before using this functionality! While the normal rules about
308+
// which Route can apply are still enforced, it is simply easier for the wrong
309+
// Route to be accidentally attached to this Gateway in this configuration. If the
310+
// Gateway operator is not also the operator in control of the scope (e.g.
311+
// namespace) with tight controls and checks on what kind of workloads and
312+
// Routes get added in that scope, we strongly recommend not using this just
313+
// because it seems convenient, and instead stick to explicit Route attachment.
304314
//
305315
// +optional
306316
// <gateway:experimental>

apis/v1/shared_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ type CommonRouteSpec struct {
241241
// <gateway:experimental:validation:XValidation:message="sectionName or port must be unique when parentRefs includes 2 or more references to the same parent",rule="self.all(p1, self.exists_one(p2, p1.group == p2.group && p1.kind == p2.kind && p1.name == p2.name && (((!has(p1.__namespace__) || p1.__namespace__ == '') && (!has(p2.__namespace__) || p2.__namespace__ == '')) || (has(p1.__namespace__) && has(p2.__namespace__) && p1.__namespace__ == p2.__namespace__ )) && (((!has(p1.sectionName) || p1.sectionName == '') && (!has(p2.sectionName) || p2.sectionName == '')) || ( has(p1.sectionName) && has(p2.sectionName) && p1.sectionName == p2.sectionName)) && (((!has(p1.port) || p1.port == 0) && (!has(p2.port) || p2.port == 0)) || (has(p1.port) && has(p2.port) && p1.port == p2.port))))">
242242
ParentRefs []ParentReference `json:"parentRefs,omitempty"`
243243

244-
// useDefaultGateway indicates the default Gateway scope to use for this
244+
// UseDefaultGateway indicates the default Gateway scope to use for this
245245
// Route. If unset (the default), the Route will not be attached to any
246246
// default Gateway; if set, it will be attached to any default Gateway
247247
// supporting the named scope, subject to the usual rules about which
@@ -251,7 +251,8 @@ type CommonRouteSpec struct {
251251
// Gateways supporting the requested scope can change over time without
252252
// any notice to the Route author, and in many situations it will not be
253253
// appropriate to request a default Gateway for a given Route -- for
254-
// example, a Route with specific security needs should almost certainly
254+
// example, a Route with specific security requirements should almost certainly
255+
// not use a default Gateway.
255256
// not use a default Gateway.
256257
//
257258
// +optional <gateway:experimental>

0 commit comments

Comments
 (0)