@@ -87,7 +87,7 @@ type GatewaySpec struct {
8787 //
8888 // If this field specifies multiple Listeners that have the same
8989 // Port value but are not compatible, the GatewayClass must raise
90- // a "PortConflict " condition on the Gateway .
90+ // a "Conflicted " condition in the Listener status .
9191 //
9292 // Support: Core
9393 //
@@ -284,11 +284,11 @@ const (
284284 HostnameMatchAny HostnameMatchType = "Any"
285285)
286286
287- // ProtocolType defines the application protocol accepted by a
288- // Listener. Implementations are not required to accept all the
289- // defined protocols. If an implementation does not support a
290- // specified protocol, it should raise a "ConditionUnsupportedProtocol"
291- // condition for the affected Listener .
287+ // ProtocolType defines the application protocol accepted by a Listener.
288+ // Implementations are not required to accept all the defined protocols.
289+ // If an implementation does not support a specified protocol, it
290+ // should raise a "Detached" condition for the affected Listener with
291+ // a reason of "UnsupportedProtocol" .
292292//
293293// Valid ProtocolType values are:
294294//
@@ -591,6 +591,8 @@ type GatewayStatus struct {
591591 // Listeners provide status for each unique listener port defined in the Spec.
592592 //
593593 // +optional
594+ // +listType=map
595+ // +listMapKey=port
594596 // +kubebuilder:validation:MaxItems=64
595597 Listeners []ListenerStatus `json:"listeners,omitempty"`
596598}
@@ -618,7 +620,7 @@ const (
618620 //
619621 // Controllers may raise this condition with other reasons,
620622 // but should prefer to use the reasons listed above to improve
621- // interoperability.`
623+ // interoperability.
622624 GatewayConditionScheduled GatewayConditionType = "Scheduled"
623625
624626 // GatewayReasonNotReconciled is used when the Gateway is
@@ -708,38 +710,138 @@ type ListenerStatus struct {
708710// field.
709711type ListenerConditionType string
710712
713+ // ListenerConditionReason defines the set of reasons that explain
714+ // why a particular Listener condition type has been raised.
715+ type ListenerConditionReason string
716+
711717const (
712- // ConditionInvalidListener is a generic condition that is a catch all for
713- // unsupported configurations that do not match a more specific condition.
714- // Implementers should try to use a more specific condition instead of this
715- // one to give users and automation more information.
716- ConditionInvalidListener ListenerConditionType = "InvalidListener"
717-
718- // ConditionListenerNotReady indicates the listener is not ready.
719- ConditionListenerNotReady ListenerConditionType = "ListenerNotReady"
720-
721- // ConditionPortConflict indicates that two or more Listeners with
722- // the same port were bound to this gateway and they could not be
723- // collapsed into a single configuration.
724- ConditionPortConflict ListenerConditionType = "PortConflict"
725-
726- // ConditionInvalidCertificateRef indicates the certificate reference of the
727- // listener's TLS configuration is invalid.
728- ConditionInvalidCertificateRef ListenerConditionType = "InvalidCertificateRef"
729-
730- // ConditionRoutesNotReady indicates that at least one of the specified
731- // routes is not ready.
732- ConditionRoutesNotReady ListenerConditionType = "RoutesNotReady"
733-
734- // ConditionInvalidRoutes indicates that at least one of the specified
735- // routes is invalid.
736- ConditionInvalidRoutes ListenerConditionType = "InvalidRoutes"
737-
738- // ConditionForbiddenRoutesForClass indicates that at least one of the
739- // routes is in a namespace forbidden by the GatewayClass.
740- ConditionForbiddenRoutesForClass ListenerConditionType = "ForbiddenRoutesForClass"
741-
742- // ConditionUnsupportedProtocol indicates that an invalid
743- // or unsupported protocol type was requested.
744- ConditionUnsupportedProtocol ListenerConditionType = "UnsupportedProtocol"
718+ // ListenerConditionConflicted indicates that the controller
719+ // was unable to resolve conflicting specification requirements
720+ // for this Listener. If a Listener is conflicted, its network
721+ // port should not be configured on any network elements.
722+ //
723+ // Possible reasons for this condition to be true are:
724+ //
725+ // * "HostnameConflict"
726+ // * "ProtocolConflict"
727+ // * "RouteConflict"
728+ //
729+ // Controllers may raise this condition with other reasons,
730+ // but should prefer to use the reasons listed above to improve
731+ // interoperability.
732+ ListenerConditionConflicted ListenerConditionType = "Conflicted"
733+
734+ // ListenerReasonHostnameConflict is used when the Listener
735+ // violates the Hostname match constraints that allow collapsing
736+ // Listeners. For example, this reason would be used when multiple
737+ // Listeners on the same port use the "Any" hostname match type.
738+ ListenerReasonHostnameConflict ListenerConditionReason = "HostnameConflict"
739+
740+ // ListenerReasonProtocolConflict is used when multiple
741+ // Listeners are specified with the same Listener port number,
742+ // but have conflicting protocol specifications.
743+ ListenerReasonProtocolConflict ListenerConditionReason = "ProtocolConflict"
744+
745+ // ListenerReasonRouteConflict is used when the route
746+ // resources selected for this Listener conflict with other
747+ // specified properties of the Listener (e.g. Protocol).
748+ // For example, a Listener that specifies "UDP" as the protocol
749+ // but a route selector that resolves "TCPRoute" objects.
750+ ListenerReasonRouteConflict ListenerConditionReason = "RouteConflict"
751+ )
752+
753+ const (
754+ // ListenerConditionDetached indicates that, even though
755+ // the listener is syntactically and semantically valid, the
756+ // controller is not able to configure it on the underlying
757+ // Gateway infrastructure.
758+ //
759+ // A Listener is specified as a logical requirement, but needs to be
760+ // configured on a network endpoint (i.e. address and port) by a
761+ // controller. The controller may be unable to attach the Listener
762+ // if it specifies an unsupported requirement, or prerequisite
763+ // resources are not available.
764+ //
765+ // Possible reasons for this condition to be true are:
766+ //
767+ // * "PortUnavailable"
768+ // * "UnsupportedExtension"
769+ // * "UnsupportedProtocol"
770+ //
771+ // Controllers may raise this condition with other reasons,
772+ // but should prefer to use the reasons listed above to improve
773+ // interoperability.
774+ ListenerConditionDetached ListenerConditionType = "Detached"
775+
776+ // ListenerReasonPortUnavailable is used when the Listener
777+ // requests a port that cannot be used on the Gateway.
778+ ListenerReasonPortUnavailable ListenerConditionReason = "PortUnavailable"
779+
780+ // ListenerReasonUnsupportedExtension is used when the
781+ // controller detects that an implementation-specific Listener
782+ // extension is being requested, but is not able to support
783+ // the extension.
784+ ListenerReasonUnsupportedExtension ListenerConditionReason = "UnsupportedExtension"
785+
786+ // ListenerReasonUnsupportedProtocol is used when the
787+ // Listener could not be attached to be Gateway because its
788+ // protocol type is not supported.
789+ ListenerReasonUnsupportedProtocol ListenerConditionReason = "UnsupportedProtocol"
790+ )
791+
792+ const (
793+ // ListenerConditionResolvedRefs indicates whether the
794+ // controller was able to resolve all the object references
795+ // for the Listener.
796+ //
797+ // Possible reasons for this condition to be false are:
798+ //
799+ // * "DroppedRoutes"
800+ // * "InvalidCertificateRef"
801+ // * "InvalidRoutesRef"
802+ //
803+ // Controllers may raise this condition with other reasons,
804+ // but should prefer to use the reasons listed above to improve
805+ // interoperability.
806+ ListenerConditionResolvedRefs ListenerConditionType = "ResolvedRefs"
807+
808+ // ListenerReasonDroppedRoutes indicates that not all of the routes
809+ // selected by this Listener could be configured. The specific
810+ // reason why each route was dropped should be indicated in the
811+ // route's .Status.Conditions field.
812+ ListenerReasonDroppedRoutes ListenerConditionReason = "DroppedRoutes"
813+
814+ // ListenerReasonInvalidCertificateRef is used when the
815+ // Listener has a TLS configuration with a TLS CertificateRef
816+ // that is invalid or cannot be resolved.
817+ ListenerReasonInvalidCertificateRef ListenerConditionReason = "InvalidCertificateRef"
818+
819+ // ListenerReasonInvalidRoutesRef is used when the Listener's Routes
820+ // selector is invalid or cannot be resolved. Note that it is not
821+ // an error for this selector to not resolve any Routes, and the
822+ // "ResolvedRefs" status condition should not be raised in that case.
823+ ListenerReasonInvalidRoutesRef ListenerConditionReason = "InvalidRoutesRef"
824+ )
825+
826+ const (
827+ // ListenerConditionReady indicates whether the Listener
828+ // has been configured on the Gateway.
829+ //
830+ // Possible reasons for this condition to be false are:
831+ //
832+ // * "Invalid"
833+ // * "Pending"
834+ //
835+ // Controllers may raise this condition with other reasons,
836+ // but should prefer to use the reasons listed above to improve
837+ // interoperability.
838+ ListenerConditionReady ListenerConditionType = "Ready"
839+
840+ // ListenerReasonInvalid is used when the Listener is
841+ // syntactically or semantically invalid.
842+ ListenerReasonInvalid ListenerConditionReason = "Invalid"
843+
844+ // ListenerReasonPending is used when the Listener is not
845+ // yet not online and ready to accept client traffic.
846+ ListenerReasonPending ListenerConditionReason = "Pending"
745847)
0 commit comments