Documentation ¶
Index ¶
- Constants
- Variables
- func AllNamespace() func(string) bool
- func IterateIndices(f func(client.Object, string, client.IndexerFunc) error) error
- func ProcessBackendRef(obj client.Object, err error, reporter reports.ParentRefReporter, ...) *string
- func ReferenceAllowed(ctx context.Context, fromgk metav1.GroupKind, fromns string, ...) bool
- func SameNamespace(ns string) func(string) bool
- type Error
- type From
- type FromGkNs
- type FromObject
- type GatewayQueries
- type GroupKindNs
- type ListenerResult
- type ListenerRouteResult
- type RouteError
- type RoutesForGwResult
Constants ¶
View Source
const ( HttpRouteTargetField = "http-route-target" ReferenceGrantFromField = "ref-grant-from" )
Variables ¶
View Source
var ( ErrMissingReferenceGrant = fmt.Errorf("missing reference grant") ErrUnknownKind = fmt.Errorf("unknown kind") ErrNoMatchingListenerHostname = fmt.Errorf("no matching listener hostname") ErrNoMatchingParent = fmt.Errorf("no matching parent") ErrNotAllowedByListeners = fmt.Errorf("not allowed by listeners") ErrLocalObjRefMissingKind = fmt.Errorf("localObjRef provided with empty kind") )
Functions ¶
func AllNamespace ¶
func IterateIndices ¶
func ProcessBackendRef ¶
func ProcessBackendRef(obj client.Object, err error, reporter reports.ParentRefReporter, backendRef gwv1.BackendObjectReference) *string
ProcessBackendRef is meant to take the result of a call to `GetBackendForRef` as well as a reporter and the original ref. The return value is a pointer to a string which is the cluster_name of the upstream that the ref resolved to. This function will return nil if the ref is not valid. This function will also set the appropriate condition on the parent via the reporter.
func ReferenceAllowed ¶
func SameNamespace ¶
Types ¶
type Error ¶
type Error struct { Reason apiv1.RouteConditionReason E error }
type FromObject ¶
func (FromObject) Namespace ¶
func (f FromObject) Namespace() string
type GatewayQueries ¶
type GatewayQueries interface { ObjToFrom(obj client.Object) From // Returns map of listener names -> list of http routes. GetRoutesForGw(ctx context.Context, gw *apiv1.Gateway) (RoutesForGwResult, error) // Given a backendRef that resides in namespace obj, return the service that backs it. // This will error with `ErrMissingReferenceGrant` if there is no reference grant allowing the reference // return value depends on the group/kind in the backendRef. GetBackendForRef(ctx context.Context, obj From, backendRef *apiv1.BackendObjectReference) (client.Object, error) GetSecretForRef(ctx context.Context, obj From, secretRef apiv1.SecretObjectReference) (client.Object, error) GetLocalObjRef(ctx context.Context, from From, localObjRef apiv1.LocalObjectReference) (client.Object, error) }
type GroupKindNs ¶
type GroupKindNs struct {
// contains filtered or unexported fields
}
func NewGroupKindNs ¶
func NewGroupKindNs(gk metav1.GroupKind, ns string) *GroupKindNs
func (*GroupKindNs) Namespace ¶
func (g *GroupKindNs) Namespace() string
type ListenerResult ¶
type ListenerResult struct { Error error Routes []*ListenerRouteResult }
type ListenerRouteResult ¶
type ListenerRouteResult struct { Route apiv1.HTTPRoute ParentRef apiv1.ParentReference Hostnames []string }
type RouteError ¶
type RouteError struct { Route apiv1.HTTPRoute ParentRef apiv1.ParentReference Error Error }
type RoutesForGwResult ¶
type RoutesForGwResult struct { // key is listener name ListenerResults map[string]*ListenerResult RouteErrors []*RouteError }
Click to show internal directories.
Click to hide internal directories.