Documentation
¶
Index ¶
- Constants
- func ComputeHosts(routeHostnames []v1beta1.Hostname, listenerHostname *v1beta1.Hostname) []string
- func FromNamespacesPtr(fromNamespaces v1beta1.FromNamespaces) *v1beta1.FromNamespaces
- func GatewayAddressTypePtr(addr v1beta1.AddressType) *v1beta1.AddressType
- func GatewayOwnerLabels(namespace, name string) map[string]string
- func GroupDerefOr(group *v1beta1.Group, defaultGroup string) string
- func GroupPtr(name string) *v1beta1.Group
- func HasReadyListener(listeners []*ListenerContext) bool
- func HeaderMatchTypeDerefOr(matchType *v1beta1.HeaderMatchType, defaultType v1beta1.HeaderMatchType) v1beta1.HeaderMatchType
- func Int32Ptr(val int32) *int32
- func IsRefToGateway(parentRef v1beta1.ParentReference, gateway types.NamespacedName) bool
- func KindPtr(name string) *v1beta1.Kind
- func NamespaceDerefOr(namespace *v1beta1.Namespace, defaultNamespace string) string
- func NamespacePtr(name string) *v1beta1.Namespace
- func ObjectNamePtr(val string) *v1alpha2.ObjectName
- func PathMatchTypeDerefOr(matchType *v1beta1.PathMatchType, defaultType v1beta1.PathMatchType) v1beta1.PathMatchType
- func PathMatchTypePtr(pType v1beta1.PathMatchType) *v1beta1.PathMatchType
- func PortNumPtr(val int32) *v1beta1.PortNumber
- func StringPtr(val string) *string
- type GatewayContext
- type HTTPRouteContext
- type InfraIRMap
- type ListenerContext
- func (l *ListenerContext) AllowsKind(kind v1beta1.RouteGroupKind) bool
- func (l *ListenerContext) AllowsNamespace(namespace *v1.Namespace) bool
- func (l *ListenerContext) GetConditions() []metav1.Condition
- func (l *ListenerContext) IncrementAttachedRoutes()
- func (l *ListenerContext) IsReady() bool
- func (l *ListenerContext) ResetAttachedRoutes()
- func (l *ListenerContext) SetCondition(conditionType v1beta1.ListenerConditionType, status metav1.ConditionStatus, ...)
- func (l *ListenerContext) SetSupportedKinds(kinds ...v1beta1.RouteGroupKind)
- func (l *ListenerContext) SetTLSSecret(tlsSecret *v1.Secret)
- type Resources
- type RouteParentContext
- type TranslateResult
- type Translator
- func (t *Translator) GetRelevantGateways(gateways []*v1beta1.Gateway) []*GatewayContext
- func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways []*GatewayContext, ...) []*HTTPRouteContext
- func (t *Translator) ProcessListeners(gateways []*GatewayContext, xdsIR XdsIRMap, infraIR InfraIRMap, ...)
- func (t *Translator) Translate(resources *Resources) *TranslateResult
- type XdsIRMap
Constants ¶
const ( KindGateway = "Gateway" KindHTTPRoute = "HTTPRoute" KindService = "Service" KindSecret = "Secret" // OwningGatewayNamespaceLabel is the owner reference label used for managed infra. // The value should be the namespace of the accepted Envoy Gateway. OwningGatewayNamespaceLabel = "gateway.envoyproxy.io/owning-gateway-namespace" // OwningGatewayNameLabel is the owner reference label used for managed infra. // The value should be the name of the accepted Envoy Gateway. OwningGatewayNameLabel = "gateway.envoyproxy.io/owning-gateway-name" )
Variables ¶
This section is empty.
Functions ¶
func ComputeHosts ¶
ComputeHosts returns a list of the intersecting hostnames between the route and the listener.
func FromNamespacesPtr ¶
func FromNamespacesPtr(fromNamespaces v1beta1.FromNamespaces) *v1beta1.FromNamespaces
func GatewayAddressTypePtr ¶
func GatewayAddressTypePtr(addr v1beta1.AddressType) *v1beta1.AddressType
func GatewayOwnerLabels ¶
GatewayOwnerLabels returns the Gateway Owner labels using the provided namespace and name as the values.
func HasReadyListener ¶
func HasReadyListener(listeners []*ListenerContext) bool
HasReadyListener returns true if at least one Listener in the provided list has a condition of "Ready: true", and false otherwise.
func HeaderMatchTypeDerefOr ¶
func HeaderMatchTypeDerefOr(matchType *v1beta1.HeaderMatchType, defaultType v1beta1.HeaderMatchType) v1beta1.HeaderMatchType
func IsRefToGateway ¶
func IsRefToGateway(parentRef v1beta1.ParentReference, gateway types.NamespacedName) bool
IsRefToGateway returns whether the provided parent ref is a reference to a Gateway with the given namespace/name, irrespective of whether a section/listener name has been specified (i.e. a parent ref to a listener on the specified gateway will return "true").
func NamespaceDerefOr ¶
func NamespacePtr ¶
func ObjectNamePtr ¶
func ObjectNamePtr(val string) *v1alpha2.ObjectName
func PathMatchTypeDerefOr ¶
func PathMatchTypeDerefOr(matchType *v1beta1.PathMatchType, defaultType v1beta1.PathMatchType) v1beta1.PathMatchType
func PathMatchTypePtr ¶
func PathMatchTypePtr(pType v1beta1.PathMatchType) *v1beta1.PathMatchType
func PortNumPtr ¶
func PortNumPtr(val int32) *v1beta1.PortNumber
Types ¶
type GatewayContext ¶
GatewayContext wraps a Gateway and provides helper methods for setting conditions, accessing Listeners, etc.
func (*GatewayContext) GetListenerContext ¶
func (g *GatewayContext) GetListenerContext(listenerName v1beta1.SectionName) *ListenerContext
func (*GatewayContext) SetCondition ¶
func (g *GatewayContext) SetCondition(conditionType v1beta1.GatewayConditionType, status metav1.ConditionStatus, reason v1beta1.GatewayConditionReason, message string)
type HTTPRouteContext ¶
HTTPRouteContext wraps an HTTPRoute and provides helper methods for accessing the route's parents.
func (*HTTPRouteContext) GetRouteParentContext ¶
func (h *HTTPRouteContext) GetRouteParentContext(forParentRef v1beta1.ParentReference) *RouteParentContext
type InfraIRMap ¶
type ListenerContext ¶
ListenerContext wraps a Listener and provides helper methods for setting conditions and other status information on the associated Gateway, etc.
func GetReferencedListeners ¶
func GetReferencedListeners(parentRef v1beta1.ParentReference, gateways []*GatewayContext) (bool, []*ListenerContext)
GetReferencedListeners returns whether a given parent ref references a Gateway in the given list, and if so, a list of the Listeners within that Gateway that are included by the parent ref (either one specific Listener, or all Listeners in the Gateway, depending on whether section name is specified or not).
func (*ListenerContext) AllowsKind ¶
func (l *ListenerContext) AllowsKind(kind v1beta1.RouteGroupKind) bool
func (*ListenerContext) AllowsNamespace ¶
func (l *ListenerContext) AllowsNamespace(namespace *v1.Namespace) bool
func (*ListenerContext) GetConditions ¶
func (l *ListenerContext) GetConditions() []metav1.Condition
func (*ListenerContext) IncrementAttachedRoutes ¶
func (l *ListenerContext) IncrementAttachedRoutes()
func (*ListenerContext) IsReady ¶
func (l *ListenerContext) IsReady() bool
func (*ListenerContext) ResetAttachedRoutes ¶
func (l *ListenerContext) ResetAttachedRoutes()
func (*ListenerContext) SetCondition ¶
func (l *ListenerContext) SetCondition(conditionType v1beta1.ListenerConditionType, status metav1.ConditionStatus, reason v1beta1.ListenerConditionReason, message string)
func (*ListenerContext) SetSupportedKinds ¶
func (l *ListenerContext) SetSupportedKinds(kinds ...v1beta1.RouteGroupKind)
func (*ListenerContext) SetTLSSecret ¶
func (l *ListenerContext) SetTLSSecret(tlsSecret *v1.Secret)
type Resources ¶
type Resources struct { Gateways []*v1beta1.Gateway HTTPRoutes []*v1beta1.HTTPRoute ReferenceGrants []*v1alpha2.ReferenceGrant Namespaces []*v1.Namespace Services []*v1.Service Secrets []*v1.Secret }
Resources holds the Gateway API and related resources that the translators needs as inputs.
type RouteParentContext ¶
type RouteParentContext struct { *v1beta1.ParentReference // contains filtered or unexported fields }
RouteParentContext wraps a ParentReference and provides helper methods for setting conditions and other status information on the associated HTTPRoute, etc.
func (*RouteParentContext) IsAccepted ¶
func (r *RouteParentContext) IsAccepted() bool
func (*RouteParentContext) SetCondition ¶
func (r *RouteParentContext) SetCondition(conditionType v1beta1.RouteConditionType, status metav1.ConditionStatus, reason v1beta1.RouteConditionReason, message string)
func (*RouteParentContext) SetListeners ¶
func (r *RouteParentContext) SetListeners(listeners ...*ListenerContext)
type TranslateResult ¶
type Translator ¶
type Translator struct {
GatewayClassName v1beta1.ObjectName
}
Translator translates Gateway API resources to IRs and computes status for Gateway API resources.
func (*Translator) GetRelevantGateways ¶
func (t *Translator) GetRelevantGateways(gateways []*v1beta1.Gateway) []*GatewayContext
func (*Translator) ProcessHTTPRoutes ¶
func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways []*GatewayContext, resources *Resources, xdsIR XdsIRMap) []*HTTPRouteContext
func (*Translator) ProcessListeners ¶
func (t *Translator) ProcessListeners(gateways []*GatewayContext, xdsIR XdsIRMap, infraIR InfraIRMap, resources *Resources)
func (*Translator) Translate ¶
func (t *Translator) Translate(resources *Resources) *TranslateResult