utils

package
v1.2.0-alpha.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package utils contains utility functions for gateway

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllowedListeners

func GetAllowedListeners(
	parentRef gwv1beta1.ParentReference,
	routeGvk schema.GroupVersionKind,
	routeGeneration int64,
	validListeners []gwtypes.Listener,
) []gwtypes.Listener

GetAllowedListeners returns the allowed listeners

func GetAllowedListenersAndSetStatus added in v1.2.0

func GetAllowedListenersAndSetStatus(
	parentRef gwv1beta1.ParentReference,
	routeNs string,
	routeGvk schema.GroupVersionKind,
	routeGeneration int64,
	validListeners []gwtypes.Listener,
	routeParentStatus gwv1beta1.RouteParentStatus,
) []gwtypes.Listener

GetAllowedListenersAndSetStatus returns the allowed listeners and set status

func GetValidHostnames

func GetValidHostnames(listenerHostname *gwv1beta1.Hostname, routeHostnames []gwv1beta1.Hostname) []string

GetValidHostnames returns the valid hostnames

func GetValidListenersFromGateway

func GetValidListenersFromGateway(gw *gwv1beta1.Gateway) []gwtypes.Listener

GetValidListenersFromGateway returns the valid listeners from the gateway

func GroupPointer

func GroupPointer(group string) *gwv1beta1.Group

GroupPointer returns a pointer to the given group

func HostnameMatchesWildcardHostname

func HostnameMatchesWildcardHostname(hostname, wildcardHostname string) bool

HostnameMatchesWildcardHostname returns true if the hostname matches the wildcard hostname

func IsAcceptedGateway

func IsAcceptedGateway(gateway *gwv1beta1.Gateway) bool

IsAcceptedGateway returns true if the gateway is accepted

func IsAcceptedGatewayClass

func IsAcceptedGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool

IsAcceptedGatewayClass returns true if the gateway class is accepted

func IsAcceptedPolicyAttachment added in v1.2.0

func IsAcceptedPolicyAttachment(conditions []metav1.Condition) bool

func IsActiveGateway

func IsActiveGateway(gateway *gwv1beta1.Gateway) bool

IsActiveGateway returns true if the gateway is active

func IsActiveGatewayClass

func IsActiveGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool

IsActiveGatewayClass returns true if the gateway class is active

func IsEffectiveGatewayClass

func IsEffectiveGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool

IsEffectiveGatewayClass returns true if the gateway class is effective

func IsListenerAccepted

func IsListenerAccepted(listenerStatus gwv1beta1.ListenerStatus) bool

IsListenerAccepted returns true if the listener is accepted

func IsListenerProgrammed

func IsListenerProgrammed(listenerStatus gwv1beta1.ListenerStatus) bool

IsListenerProgrammed returns true if the listener is programmed

func IsRefToGateway

func IsRefToGateway(parentRef gwv1beta1.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(targetRef gwv1alpha2.PolicyTargetReference, object 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.PolicyTargetReference, gvk schema.GroupVersionKind) bool

func Namespace added in v1.2.0

func Namespace(ns *gwv1beta1.Namespace, defaultNs string) string

Namespace returns the namespace if it is not nil, otherwise returns the default namespace

func ObjectKey

func ObjectKey(obj client.Object) client.ObjectKey

ObjectKey returns the object key for the given object

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL