helpers

package
v1.19.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GatewayClassKind      string = "gatewayclasses"
	GatewayKind           string = "gateways"
	HTTPRouteKind         string = "httproutes"
	GRPCRouteKind         string = "grpcroutes"
	ReferenceGrantKind    string = "referencegrants"
	TLSRouteKind          string = "tlsroutes"
	TLSRouteListKind      string = "tlsroutelists"
	ServiceImportKind     string = "serviceimports"
	ServiceImportListKind string = "serviceimportlists"
)

Variables

This section is empty.

Functions

func GetBackendServiceName added in v1.16.0

func GetBackendServiceName(k8sclient client.Client, namespace string, backendObjectReference gatewayv1.BackendObjectReference) (string, error)

func GetConcreteObject added in v1.17.0

func GetConcreteObject(schemaType schema.GroupVersionKind) runtime.Object

getConcreteObject returns an instance of a concrete object type based on the given GroupVersionKind.

func GetServiceName added in v1.16.0

func GetServiceName(svcImport *mcsapiv1alpha1.ServiceImport) (string, error)

func HasServiceImportSupport added in v1.16.0

func HasServiceImportSupport(scheme *runtime.Scheme) bool

HasServiceImportSupport return if the ServiceImport CRD is supported. This checks if the MCS API group ServiceImport CRD is registered in the client scheme and it is expected that it is registered only if the ServiceImport CRD has been installed prior to the client setup.

func HasTLSRouteSupport added in v1.17.4

func HasTLSRouteSupport(scheme *runtime.Scheme) bool

HasTLSRouteSupport returns if the TLSRoute CRD is supported. This checks if the Gateway API v1alpha2 TLSRoute CRD is registered in the client scheme and it is expected that it is registered only if the TLSRoute CRD has been installed prior to the client setup.

func IsBackendReferenceAllowed

func IsBackendReferenceAllowed(originatingNamespace string, be gatewayv1.BackendRef, gvk schema.GroupVersionKind, grants []gatewayv1beta1.ReferenceGrant) bool

IsBackendReferenceAllowed returns true if the backend reference is allowed by the reference grant.

func IsConditionPresent added in v1.18.3

func IsConditionPresent(conds []metav1.Condition, condType string) bool

func IsGammaService added in v1.16.0

func IsGammaService(parent gatewayv1.ParentReference) bool

func IsGammaServiceEqual added in v1.17.8

func IsGammaServiceEqual(parent gatewayv1.ParentReference, gammaService *corev1.Service, objNamespace string) bool

func IsGateway

func IsGateway(parent gatewayv1.ParentReference) bool

func IsHTTPSTerminatedListener added in v1.19.6

func IsHTTPSTerminatedListener(listener *gatewayv1.Listener) bool

IsHTTPSTerminatedListener returns true for HTTPS listeners that terminate TLS.

func IsListenerNamespaceAllowed added in v1.19.6

func IsListenerNamespaceAllowed(listener gatewayv1.Listener, routeNamespace, gatewayNamespace string, namespaces NamespaceLabelIndex) bool

IsListenerNamespaceAllowed checks whether a route in routeNamespace is permitted to attach to the given listener based on AllowedRoutes.Namespaces.

func IsSecret

func IsSecret(secret gatewayv1.SecretObjectReference) bool

func IsSecretReferenceAllowed

func IsSecretReferenceAllowed(originatingNamespace string, sr gatewayv1.SecretObjectReference, gvk schema.GroupVersionKind, grants []gatewayv1beta1.ReferenceGrant) bool

IsSecretReferenceAllowed returns true if the secret reference is allowed by the reference grant.

func IsServiceImport added in v1.16.0

func IsServiceImport(be gatewayv1.BackendObjectReference) bool

func IsTLSPassthroughListener added in v1.19.6

func IsTLSPassthroughListener(listener *gatewayv1.Listener) bool

IsTLSPassthroughListener returns true for TLS listeners configured for passthrough mode.

func ListenerHostname added in v1.19.6

func ListenerHostname(listener *gatewayv1.Listener) string

ListenerHostname returns the listener hostname, or an empty string for catch-all listeners.

func NamespaceDerefOr

func NamespaceDerefOr(namespace *gatewayv1.Namespace, defaultNamespace string) string

func SNIHostnamesIntersect added in v1.19.6

func SNIHostnamesIntersect(a, b string) bool

SNIHostnamesIntersect returns true when two hostnames can match the same SNI value. Empty hostnames are normalized to catch-all.

Types

type NamespaceLabelIndex added in v1.19.6

type NamespaceLabelIndex map[string]map[string]string

NamespaceLabelIndex indexes namespace labels by namespace name.

func NewNamespaceLabelIndex added in v1.19.6

func NewNamespaceLabelIndex(namespaces []corev1.Namespace) NamespaceLabelIndex

Jump to

Keyboard shortcuts

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