Documentation ¶
Overview ¶
Package utils contains utility functions for gateway
Index ¶
- func GetActiveGateways(allGateways []client.Object) []*gwv1.Gateway
- func GetAllowedListeners(nsLister v1.NamespaceLister, gw *gwv1.Gateway, parentRef gwv1.ParentReference, ...) ([]gwtypes.Listener, []metav1.Condition)
- func GetValidHostnames(listenerHostname *gwv1.Hostname, routeHostnames []gwv1.Hostname) []string
- func GetValidListenersForGateway(gw *gwv1.Gateway) []gwtypes.Listener
- func GroupPointer(group string) *gwv1.Group
- func HasAccessToTargetRef(policy client.Object, ref gwv1alpha2.NamespacedPolicyTargetReference, ...) bool
- func HostnameMatchesWildcardHostname(hostname, wildcardHostname string) bool
- func IsAcceptedGateway(gateway *gwv1.Gateway) bool
- func IsAcceptedGatewayClass(gatewayClass *gwv1.GatewayClass) bool
- func IsAcceptedPolicyAttachment(conditions []metav1.Condition) bool
- func IsActiveGateway(gateway *gwv1.Gateway) bool
- func IsActiveGatewayClass(gatewayClass *gwv1.GatewayClass) bool
- func IsEffectiveGatewayClass(gatewayClass *gwv1.GatewayClass) bool
- func IsListenerAccepted(listenerStatus gwv1.ListenerStatus) bool
- func IsListenerProgrammed(listenerStatus gwv1.ListenerStatus) bool
- func IsRefToGateway(parentRef gwv1.ParentReference, gateway client.ObjectKey) bool
- func IsRefToTarget(referenceGrants []client.Object, policy client.Object, ...) bool
- func IsTargetRefToGVK(targetRef gwv1alpha2.NamespacedPolicyTargetReference, ...) bool
- func Namespace(ns *gwv1.Namespace, defaultNs string) string
- func NamespaceMatches(nsLister v1.NamespaceLister, namespaces *gwv1.RouteNamespaces, ...) bool
- func ObjectKey(obj client.Object) client.ObjectKey
- func ToRouteContext(route client.Object) *gwtypes.RouteContext
- func ValidCrossNamespaceRef(referenceGrants []client.Object, from gwtypes.CrossNamespaceFrom, ...) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetActiveGateways ¶ added in v1.3.0
func GetAllowedListeners ¶
func GetAllowedListeners( nsLister v1.NamespaceLister, gw *gwv1.Gateway, parentRef gwv1.ParentReference, params *gwtypes.RouteContext, validListeners []gwtypes.Listener, ) ([]gwtypes.Listener, []metav1.Condition)
GetAllowedListeners returns the allowed listeners
func GetValidHostnames ¶
GetValidHostnames returns the valid hostnames
func GetValidListenersForGateway ¶ added in v1.3.0
GetValidListenersForGateway returns the valid listeners from the gateway
func GroupPointer ¶
GroupPointer returns a pointer to the given group
func HasAccessToTargetRef ¶ added in v1.3.0
func HasAccessToTargetRef(policy client.Object, ref gwv1alpha2.NamespacedPolicyTargetReference, referenceGrants []client.Object) bool
func HostnameMatchesWildcardHostname ¶
HostnameMatchesWildcardHostname returns true if the hostname matches the wildcard hostname
func IsAcceptedGateway ¶
IsAcceptedGateway returns true if the gateway is accepted
func IsAcceptedGatewayClass ¶
func IsAcceptedGatewayClass(gatewayClass *gwv1.GatewayClass) bool
IsAcceptedGatewayClass returns true if the gateway class is accepted
func IsAcceptedPolicyAttachment ¶ added in v1.2.0
IsAcceptedPolicyAttachment returns true if the policy attachment is accepted
func IsActiveGateway ¶
IsActiveGateway returns true if the gateway is active
func IsActiveGatewayClass ¶
func IsActiveGatewayClass(gatewayClass *gwv1.GatewayClass) bool
IsActiveGatewayClass returns true if the gateway class is active
func IsEffectiveGatewayClass ¶
func IsEffectiveGatewayClass(gatewayClass *gwv1.GatewayClass) bool
IsEffectiveGatewayClass returns true if the gateway class is effective
func IsListenerAccepted ¶
func IsListenerAccepted(listenerStatus gwv1.ListenerStatus) bool
IsListenerAccepted returns true if the listener is accepted
func IsListenerProgrammed ¶
func IsListenerProgrammed(listenerStatus gwv1.ListenerStatus) bool
IsListenerProgrammed returns true if the listener is programmed
func IsRefToGateway ¶
func IsRefToGateway(parentRef gwv1.ParentReference, gateway client.ObjectKey) bool
IsRefToGateway returns true if the parent reference is to the gateway
func IsRefToTarget ¶ added in v1.2.0
func IsRefToTarget(referenceGrants []client.Object, policy client.Object, ref gwv1alpha2.NamespacedPolicyTargetReference, target client.Object) bool
IsRefToTarget returns true if the target reference is to the target object
func IsTargetRefToGVK ¶ added in v1.2.0
func IsTargetRefToGVK(targetRef gwv1alpha2.NamespacedPolicyTargetReference, gvk schema.GroupVersionKind) bool
IsTargetRefToGVK returns true if the target reference is to the given group version kind
func Namespace ¶ added in v1.2.0
Namespace returns the namespace if it is not nil, otherwise returns the default namespace
func NamespaceMatches ¶ added in v1.3.0
func NamespaceMatches(nsLister v1.NamespaceLister, namespaces *gwv1.RouteNamespaces, gatewayNamespace, routeNamespace string) bool
NamespaceMatches returns true if the namespace matches
func ToRouteContext ¶ added in v1.3.0
func ToRouteContext(route client.Object) *gwtypes.RouteContext
func ValidCrossNamespaceRef ¶ added in v1.3.0
func ValidCrossNamespaceRef(referenceGrants []client.Object, from gwtypes.CrossNamespaceFrom, to gwtypes.CrossNamespaceTo) bool
Types ¶
This section is empty.