Documentation ¶
Index ¶
- func FilterValidSubdomains(domains, subdomains []gatewayapiv1.Hostname) []gatewayapiv1.Hostname
- func GatewayHostnames(gw *gatewayapiv1.Gateway) []gatewayapiv1.Hostname
- func GetGatewayWorkloadSelector(ctx context.Context, cli client.Client, gateway *gatewayapiv1.Gateway) (map[string]string, error)
- func GetRouteAcceptedGatewayParentKeys(route *gatewayapiv1.HTTPRoute) []client.ObjectKey
- func GetRouteAcceptedParentRefs(route *gatewayapiv1.HTTPRoute) []gatewayapiv1.ParentReference
- func IsGatewayAPIInstalled(restMapper meta.RESTMapper) (bool, error)
- func IsHTTPRouteAccepted(httpRoute *gatewayapiv1.HTTPRoute) bool
- func IsNotPolicyAccepted(policy Policy) bool
- func IsParentGateway(ref gatewayapiv1.ParentReference) bool
- func IsPolicyAccepted(policy Policy) bool
- func IsTargetRefGateway(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
- func IsTargetRefHTTPRoute(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
- func TargetHostnames(targetNetworkObject client.Object) []string
- type GatewayNode
- type Policy
- type PolicyByCreationTimestamp
- type PolicyByTargetRefKindAndCreationTimeStamp
- type PolicyClass
- type PolicyStatus
- type RouteNode
- type Topology
- type TopologyIndexes
- func (k *TopologyIndexes) GetPolicyHTTPRoute(policy Policy) *gatewayapiv1.HTTPRoute
- func (k *TopologyIndexes) GetUntargetedRoutes(gateway *gatewayapiv1.Gateway) []*gatewayapiv1.HTTPRoute
- func (k *TopologyIndexes) PoliciesFromGateway(gateway *gatewayapiv1.Gateway) []Policy
- func (k *TopologyIndexes) String() string
- type TopologyOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterValidSubdomains ¶
func FilterValidSubdomains(domains, subdomains []gatewayapiv1.Hostname) []gatewayapiv1.Hostname
FilterValidSubdomains returns every subdomain that is a subset of at least one of the (super) domains specified in the first argument.
func GatewayHostnames ¶
func GatewayHostnames(gw *gatewayapiv1.Gateway) []gatewayapiv1.Hostname
func GetRouteAcceptedGatewayParentKeys ¶
func GetRouteAcceptedGatewayParentKeys(route *gatewayapiv1.HTTPRoute) []client.ObjectKey
GetRouteAcceptedGatewayParentKeys returns the object keys of all gateways that have accepted a given route
func GetRouteAcceptedParentRefs ¶
func GetRouteAcceptedParentRefs(route *gatewayapiv1.HTTPRoute) []gatewayapiv1.ParentReference
GetRouteAcceptedParentRefs returns the list of parentRefs for which a given route has the Accepted status condition
func IsGatewayAPIInstalled ¶ added in v0.7.1
func IsGatewayAPIInstalled(restMapper meta.RESTMapper) (bool, error)
func IsHTTPRouteAccepted ¶
func IsHTTPRouteAccepted(httpRoute *gatewayapiv1.HTTPRoute) bool
IsHTTPRouteAccepted returns true if a given HTTPRoute has the Accepted status condition added by any of its parentRefs; otherwise, it returns false
func IsNotPolicyAccepted ¶ added in v0.7.1
func IsParentGateway ¶
func IsParentGateway(ref gatewayapiv1.ParentReference) bool
func IsPolicyAccepted ¶ added in v0.7.1
func IsTargetRefGateway ¶
func IsTargetRefGateway(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
func IsTargetRefHTTPRoute ¶
func IsTargetRefHTTPRoute(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
func TargetHostnames ¶
TargetHostnames returns an array of hostnames coming from the network object (HTTPRoute, Gateway)
Types ¶
type GatewayNode ¶
type GatewayNode struct { *gatewayapiv1.Gateway // contains filtered or unexported fields }
func (*GatewayNode) AttachedPolicies ¶
func (g *GatewayNode) AttachedPolicies() []Policy
func (*GatewayNode) ObjectKey ¶
func (g *GatewayNode) ObjectKey() client.ObjectKey
func (*GatewayNode) Routes ¶
func (g *GatewayNode) Routes() []RouteNode
type Policy ¶
type Policy interface { client.Object PolicyClass() PolicyClass GetTargetRef() gatewayapiv1alpha2.PolicyTargetReference GetStatus() PolicyStatus }
type PolicyByCreationTimestamp ¶
type PolicyByCreationTimestamp []Policy
func (PolicyByCreationTimestamp) Len ¶
func (a PolicyByCreationTimestamp) Len() int
func (PolicyByCreationTimestamp) Less ¶
func (a PolicyByCreationTimestamp) Less(i, j int) bool
func (PolicyByCreationTimestamp) Swap ¶
func (a PolicyByCreationTimestamp) Swap(i, j int)
type PolicyByTargetRefKindAndCreationTimeStamp ¶
type PolicyByTargetRefKindAndCreationTimeStamp []Policy
func (PolicyByTargetRefKindAndCreationTimeStamp) Len ¶
func (a PolicyByTargetRefKindAndCreationTimeStamp) Len() int
func (PolicyByTargetRefKindAndCreationTimeStamp) Less ¶
func (a PolicyByTargetRefKindAndCreationTimeStamp) Less(i, j int) bool
func (PolicyByTargetRefKindAndCreationTimeStamp) Swap ¶
func (a PolicyByTargetRefKindAndCreationTimeStamp) Swap(i, j int)
type PolicyStatus ¶
type RouteNode ¶
type RouteNode struct { *gatewayapiv1.HTTPRoute // contains filtered or unexported fields }
func (*RouteNode) AttachedPolicies ¶
func (*RouteNode) Route ¶
func (r *RouteNode) Route() *gatewayapiv1.HTTPRoute
type Topology ¶
func NewTopology ¶
func NewTopology(opts ...TopologyOpts) (*Topology, error)
func (*Topology) Gateways ¶
func (g *Topology) Gateways() []GatewayNode
type TopologyIndexes ¶
type TopologyIndexes struct {
// contains filtered or unexported fields
}
func NewTopologyIndexes ¶
func NewTopologyIndexes(t *Topology) *TopologyIndexes
func (*TopologyIndexes) GetPolicyHTTPRoute ¶
func (k *TopologyIndexes) GetPolicyHTTPRoute(policy Policy) *gatewayapiv1.HTTPRoute
GetPolicyHTTPRoute returns the HTTPRoute being targeted by the policy. The method only returns existing and accepted (by parent gateways) HTTPRoutes Type: Policy -> HTTPRoute
func (*TopologyIndexes) GetUntargetedRoutes ¶
func (k *TopologyIndexes) GetUntargetedRoutes(gateway *gatewayapiv1.Gateway) []*gatewayapiv1.HTTPRoute
GetUntargetedRoutes returns the HTTPRoutes not targeted by any kuadrant policy having the gateway given as input as parent. Gateway -> []HTTPRoute
func (*TopologyIndexes) PoliciesFromGateway ¶
func (k *TopologyIndexes) PoliciesFromGateway(gateway *gatewayapiv1.Gateway) []Policy
PoliciesFromGateway returns Kuadrant Policies which directly or indirectly are targeting the gateway given as input. Type: Gateway -> []Policy
func (*TopologyIndexes) String ¶
func (k *TopologyIndexes) String() string
String representation of the topology This is not designed to be a serialization format that could be deserialized
type TopologyOpts ¶
type TopologyOpts func(*topologyOptions)
TopologyOpts allows to manipulate topologyOptions.
func WithGateways ¶
func WithGateways(gateways []*gatewayapiv1.Gateway) TopologyOpts
func WithLogger ¶
func WithLogger(logger logr.Logger) TopologyOpts
func WithPolicies ¶
func WithPolicies(policies []Policy) TopologyOpts
func WithRoutes ¶
func WithRoutes(routes []*gatewayapiv1.HTTPRoute) TopologyOpts