Documentation
¶
Index ¶
- Constants
- Variables
- func FindAppliedRouteFilter(routeCtx *plugins.RouteContext, filterType gwv1.HTTPRouteFilterType) *gwv1.HTTPRouteFilter
- func FindAppliedRouteFilters(routeCtx *plugins.RouteContext, filterTypes ...gwv1.HTTPRouteFilterType) []gwv1.HTTPRouteFilter
- func FindExtensionRefFilters(rule *gwv1.HTTPRouteRule, gk schema.GroupKind) []gwv1.HTTPRouteFilter
- func GetExtensionRefObj[T client.Object](ctx context.Context, route *gwv1.HTTPRoute, queries query.GatewayQueries, ...) (T, error)
- func GetExtensionRefObjFrom[T client.Object](ctx context.Context, from query.From, queries query.GatewayQueries, ...) (T, error)
- func GetPrioritizedListenerPolicies[T client.Object](items []PolicyWithSectionedTargetRefs[T], listener *gwv1.Listener, ...) []T
- func IndexTargetRefsNnk[T policyTargetReference](targetRefs []T, namespace string, gvks []schema.GroupVersionKind) []string
- func IndexTargetRefsNns[T policyTargetReference](targetRefs []T, namespace string, gvks []schema.GroupVersionKind) []string
- type NamespacedNameKind
- type PolicyWithSectionedTargetRefs
Constants ¶
const NamespacedNameKindSeparator = '/'
Variables ¶
var ( ErrUnexpectedListenerType = errors.New("unexpected listener type") ErrUnexpectedListener = func(l *gloov1.Listener) error { return fmt.Errorf("%w: expected AggregateListener, got %T", ErrUnexpectedListenerType, l.GetListenerType()) } ListenerTargetRefGVKs = []schema.GroupVersionKind{ wellknown.GatewayGVK, wellknown.XListenerSetGVK, } )
var ErrTypesNotEqual = fmt.Errorf("types not equal")
Functions ¶
func FindAppliedRouteFilter ¶
func FindAppliedRouteFilter( routeCtx *plugins.RouteContext, filterType gwv1.HTTPRouteFilterType, ) *gwv1.HTTPRouteFilter
FindAppliedRouteFilter finds the first instance of the filterType supplied in the Rule being processed. Returns nil if the Rule doesn't contain a filter of the provided Type
func FindAppliedRouteFilters ¶
func FindAppliedRouteFilters( routeCtx *plugins.RouteContext, filterTypes ...gwv1.HTTPRouteFilterType, ) []gwv1.HTTPRouteFilter
FindAppliedRouteFilters finds all instances of the supplied filterTypes for the Rule supplied in the RouteContext. Should only be used for plugins that support multiple filters as part of a single Rule
func FindExtensionRefFilters ¶ added in v1.17.4
func FindExtensionRefFilters( rule *gwv1.HTTPRouteRule, gk schema.GroupKind, ) []gwv1.HTTPRouteFilter
FindExtensionRefFilters returns a list ExtensionRef filters that references the supplied GroupKind in the Rule being processed. Returns nil if the Rule doesn't contain a matching ExtensionRef filter
func GetExtensionRefObj ¶
func GetExtensionRefObj[T client.Object]( ctx context.Context, route *gwv1.HTTPRoute, queries query.GatewayQueries, extensionRef *gwv1.LocalObjectReference, ) (T, error)
GetExtensionRefObj uses the provided query engine to retrieve an ExtensionRef object and return the object of the same type as the type parameter. An error will be returned if the Get was unsuccessful or if the type parameter was not correct. A nil error indicates success and `obj` should be usable as normal.
func GetExtensionRefObjFrom ¶
func GetPrioritizedListenerPolicies ¶
func GetPrioritizedListenerPolicies[T client.Object]( items []PolicyWithSectionedTargetRefs[T], listener *gwv1.Listener, parentGwName string, parentListenerSet *apixv1a1.XListenerSet, ) []T
GetPrioritizedListenerPolicies accepts a slice of Gateway-attached policies (that may explicitly target a specific Listener and returns a slice of these policies (or a subset) resources. The returned policy list is sorted by specificity in the order of
ListenerSet targetRefs:
- older with section name
- newer with section name
- older without section name
- newer without section name
Gateway targetRefs:
- older with section name
- newer with section name
- older without section name
- newer without section name
This function will process all targetRefs for each policy
func IndexTargetRefsNnk ¶ added in v1.19.0
func IndexTargetRefsNnk[T policyTargetReference](targetRefs []T, namespace string, gvks []schema.GroupVersionKind) []string
IndexTargetRefsNnk indexes a list of policy target references by namespace, name, and kind. The kinds parameter is a list of GroupVersionKinds that are allowed to be indexed, though version is ignored.
func IndexTargetRefsNns ¶ added in v1.19.0
func IndexTargetRefsNns[T policyTargetReference](targetRefs []T, namespace string, gvks []schema.GroupVersionKind) []string
IndexTargetRefsNns indexes a list of policy target references by namespace and name. The kinds parameter is a list of GroupVersionKinds that are allowed to be indexed, though version is ignored.
Types ¶
type NamespacedNameKind ¶ added in v1.19.0
func (NamespacedNameKind) String ¶ added in v1.19.0
func (n NamespacedNameKind) String() string
type PolicyWithSectionedTargetRefs ¶
type PolicyWithSectionedTargetRefs[T client.Object] interface { GetTargetRefs() []*skv2corev1.PolicyTargetReferenceWithSectionName GetObject() T }
PolicyWithSectionedTargetRefs is a wrapper type to represent policy objects that attach via TargetRefWtihSectionName