Skip to content

Commit cb6dd21

Browse files
committed
Add ParametersRef to Gateway.spec.infrastructure
1 parent 1e90efc commit cb6dd21

File tree

11 files changed

+297
-3
lines changed

11 files changed

+297
-3
lines changed

apis/applyconfiguration/apis/v1/gatewayinfrastructure.go

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

apis/applyconfiguration/apis/v1/localparametersreference.go

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

apis/applyconfiguration/internal/internal.go

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

apis/applyconfiguration/utils.go

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

apis/v1/gateway_types.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,37 @@ type GatewayInfrastructure struct {
654654
// +optional
655655
// +kubebuilder:validation:MaxProperties=8
656656
Annotations map[AnnotationKey]AnnotationValue `json:"annotations,omitempty"`
657+
658+
// ParametersRef is a reference to a resource that contains the configuration
659+
// parameters corresponding to the Gateway. This is optional if the
660+
// controller does not require any additional configuration.
661+
//
662+
// This follows the same semantics as GatewayClass's `parametersRef`, but on a per-Gateway basis
663+
//
664+
// The Gateway's GatewayClass may provide its own `parametersRef`. When both are specified,
665+
// the merging behavior is implementation specific.
666+
// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
667+
//
668+
// Support: Implementation-specific
669+
//
670+
// +optional
671+
ParametersRef *LocalParametersReference `json:"parametersRef,omitempty"`
672+
}
673+
674+
// LocalParametersReference identifies an API object containing controller-specific
675+
// configuration resource within the namespace.
676+
type LocalParametersReference struct {
677+
// Group is the group of the referent.
678+
Group Group `json:"group"`
679+
680+
// Kind is kind of the referent.
681+
Kind Kind `json:"kind"`
682+
683+
// Name is the name of the referent.
684+
//
685+
// +kubebuilder:validation:MinLength=1
686+
// +kubebuilder:validation:MaxLength=253
687+
Name string `json:"name"`
657688
}
658689

659690
// GatewayConditionType is a type of condition associated with a
@@ -756,6 +787,7 @@ const (
756787
// Possible reasons for this condition to be False are:
757788
//
758789
// * "Invalid"
790+
// * "InvalidParameters"
759791
// * "NotReconciled"
760792
// * "UnsupportedAddress"
761793
// * "ListenersNotValid"
@@ -789,6 +821,11 @@ const (
789821
// Gateway could not be accepted because an address that was provided is a
790822
// type which is not supported by the implementation.
791823
GatewayReasonUnsupportedAddress GatewayConditionReason = "UnsupportedAddress"
824+
825+
// This reason is used with the "Accepted" condition when the
826+
// Gateway was not accepted because the parametersRef field
827+
// was invalid, with more detail in the message.
828+
GatewayReasonInvalidParameters GatewayConditionReason = "InvalidParameters"
792829
)
793830

794831
const (

apis/v1/gatewayclass_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ type GatewayClassSpec struct {
9595
// If the referent cannot be found, the GatewayClass's "InvalidParameters"
9696
// status condition will be true.
9797
//
98+
// A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified,
99+
// the merging behavior is implementation specific.
100+
// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
101+
//
98102
// Support: Implementation-specific
99103
//
100104
// +optional

apis/v1/zz_generated.deepcopy.go

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

config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml

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

config/crd/experimental/gateway.networking.k8s.io_gateways.yaml

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

config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml

Lines changed: 10 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)