Documentation ¶
Index ¶
- func FilterValidSubdomains(domains, subdomains []gatewayapiv1.Hostname) []gatewayapiv1.Hostname
- func GatewayHostnames(gw *gatewayapiv1.Gateway) []gatewayapiv1.Hostname
- func GetGatewayParentKeys(route *gatewayapiv1.HTTPRoute) []client.ObjectKey
- func GetGatewayParentRefsFromRoute(route *gatewayapiv1.HTTPRoute) []gatewayapiv1.ParentReference
- 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 IsCRDInstalled(restMapper meta.RESTMapper, group, kind, version string) (bool, error)
- func IsCertManagerInstalled(restMapper meta.RESTMapper, logger logr.Logger) (bool, error)
- 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.LocalPolicyTargetReference) bool
- func IsTargetRefHTTPRoute(targetRef gatewayapiv1alpha2.LocalPolicyTargetReference) bool
- func TargetHostnames(targetNetworkObject client.Object) []string
- type GatewayNode
- func (g *GatewayNode) AttachedPolicies() []PolicyNode
- func (g *GatewayNode) GetGateway() *gatewayapiv1.Gateway
- func (g *GatewayNode) GetGatewayNode() *GatewayNode
- func (g *GatewayNode) GetObject() client.Object
- func (g *GatewayNode) GetRouteNode() *RouteNode
- func (g GatewayNode) ID() dag.NodeID
- func (g *GatewayNode) ObjectKey() client.ObjectKey
- func (g *GatewayNode) Routes() []RouteNode
- type Policy
- type PolicyByCreationTimestamp
- type PolicyByTargetRefKindAndAcceptedStatus
- type PolicyByTargetRefKindAndCreationTimeStamp
- type PolicyClass
- type PolicyNode
- type PolicyStatus
- type PolicyTargetNode
- type PolicyType
- type RouteNode
- func (r *RouteNode) AttachedPolicies() []PolicyNode
- func (r *RouteNode) GetGatewayNode() *GatewayNode
- func (r *RouteNode) GetObject() client.Object
- func (r *RouteNode) GetRouteNode() *RouteNode
- func (h RouteNode) ID() dag.NodeID
- func (r *RouteNode) ObjectKey() client.ObjectKey
- func (r *RouteNode) Route() *gatewayapiv1.HTTPRoute
- type Topology
- type TopologyIndexes
- func (k *TopologyIndexes) GetPolicyHTTPRoute(policy Policy) *gatewayapiv1.HTTPRoute
- func (k *TopologyIndexes) GetPolicyTargetObject(policy Policy) client.Object
- func (k *TopologyIndexes) GetUntargetedRoutes(gateway *gatewayapiv1.Gateway) []*gatewayapiv1.HTTPRoute
- func (k *TopologyIndexes) PoliciesFromGateway(gateway *gatewayapiv1.Gateway) []Policy
- func (k *TopologyIndexes) String() string
- type TopologyOpts
- func WithAcceptedRoutesLinkedOnly() TopologyOpts
- func WithGateways(gateways []*gatewayapiv1.Gateway) TopologyOpts
- func WithLogger(logger logr.Logger) TopologyOpts
- func WithPolicies(policies []Policy) TopologyOpts
- func WithProgrammedGatewaysOnly() TopologyOpts
- func WithRoutes(routes []*gatewayapiv1.HTTPRoute) TopologyOpts
- type Type
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 GetGatewayParentKeys ¶ added in v0.10.0
func GetGatewayParentKeys(route *gatewayapiv1.HTTPRoute) []client.ObjectKey
GetGatewayParentKeys returns the object keys of all parent gateways
func GetGatewayParentRefsFromRoute ¶ added in v0.10.0
func GetGatewayParentRefsFromRoute(route *gatewayapiv1.HTTPRoute) []gatewayapiv1.ParentReference
GetGatewayParentRefsFromRoute returns the list of parentRefs that are Gateway typed
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 IsCRDInstalled ¶ added in v0.11.0
func IsCRDInstalled(restMapper meta.RESTMapper, group, kind, version string) (bool, error)
func IsCertManagerInstalled ¶ added in v0.10.0
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.LocalPolicyTargetReference) bool
func IsTargetRefHTTPRoute ¶
func IsTargetRefHTTPRoute(targetRef gatewayapiv1alpha2.LocalPolicyTargetReference) bool
func TargetHostnames ¶
TargetHostnames returns an array of hostnames coming from the network object (HTTPRoute, Gateway)
Types ¶
type GatewayNode ¶
type GatewayNode struct {
// contains filtered or unexported fields
}
func (*GatewayNode) AttachedPolicies ¶
func (g *GatewayNode) AttachedPolicies() []PolicyNode
func (*GatewayNode) GetGateway ¶ added in v0.10.0
func (g *GatewayNode) GetGateway() *gatewayapiv1.Gateway
func (*GatewayNode) GetGatewayNode ¶ added in v0.10.0
func (g *GatewayNode) GetGatewayNode() *GatewayNode
func (*GatewayNode) GetObject ¶ added in v0.11.0
func (g *GatewayNode) GetObject() client.Object
func (*GatewayNode) GetRouteNode ¶ added in v0.10.0
func (g *GatewayNode) GetRouteNode() *RouteNode
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.LocalPolicyTargetReference 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 PolicyByTargetRefKindAndAcceptedStatus ¶ added in v0.10.0
type PolicyByTargetRefKindAndAcceptedStatus []Policy
func (PolicyByTargetRefKindAndAcceptedStatus) Len ¶ added in v0.10.0
func (a PolicyByTargetRefKindAndAcceptedStatus) Len() int
func (PolicyByTargetRefKindAndAcceptedStatus) Less ¶ added in v0.10.0
func (a PolicyByTargetRefKindAndAcceptedStatus) Less(i, j int) bool
func (PolicyByTargetRefKindAndAcceptedStatus) Swap ¶ added in v0.10.0
func (a PolicyByTargetRefKindAndAcceptedStatus) 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 PolicyNode ¶ added in v0.10.0
type PolicyNode struct {
// contains filtered or unexported fields
}
func (*PolicyNode) GetPolicy ¶ added in v0.10.0
func (p *PolicyNode) GetPolicy() Policy
func (*PolicyNode) TargetRef ¶ added in v0.10.0
func (p *PolicyNode) TargetRef() PolicyTargetNode
type PolicyStatus ¶
type PolicyTargetNode ¶ added in v0.10.0
type PolicyTargetNode interface { GetGatewayNode() *GatewayNode GetRouteNode() *RouteNode GetObject() client.Object AttachedPolicies() []PolicyNode }
type PolicyType ¶ added in v0.10.0
type RouteNode ¶
type RouteNode struct {
// contains filtered or unexported fields
}
func (*RouteNode) AttachedPolicies ¶
func (r *RouteNode) AttachedPolicies() []PolicyNode
func (*RouteNode) GetGatewayNode ¶ added in v0.10.0
func (r *RouteNode) GetGatewayNode() *GatewayNode
func (*RouteNode) GetRouteNode ¶ added in v0.10.0
func (*RouteNode) Route ¶
func (r *RouteNode) Route() *gatewayapiv1.HTTPRoute
type Topology ¶
Topology defines a graph with Gateway API entities. Contains GatewayNodes (Gateway API gateways) Contains RouteNodes (Gateway API httproutes) Contains PolicyNodes (Gateway API policy attachment objects) Hierarchy is as follows. GatewayNode children can be either RouteNode or PolicyNode nodes RouteNode children are PolicyNode nodes PolicyNode parents can be either RouteNode or GatewayNode nodes
func NewTopology ¶
func NewTopology(opts ...TopologyOpts) (*Topology, error)
func (*Topology) Gateways ¶
func (g *Topology) Gateways() []GatewayNode
func (*Topology) GetPolicy ¶ added in v0.10.0
func (g *Topology) GetPolicy(policy Policy) (PolicyNode, bool)
func (*Topology) Policies ¶ added in v0.10.0
func (g *Topology) Policies() []PolicyNode
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) GetPolicyTargetObject ¶ added in v0.11.0
func (k *TopologyIndexes) GetPolicyTargetObject(policy Policy) client.Object
GetPolicyTargetObject returns the client.Object targeted by the policy. Type: Policy -> client.Object
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 WithAcceptedRoutesLinkedOnly ¶ added in v0.10.0
func WithAcceptedRoutesLinkedOnly() TopologyOpts
func WithGateways ¶
func WithGateways(gateways []*gatewayapiv1.Gateway) TopologyOpts
func WithLogger ¶
func WithLogger(logger logr.Logger) TopologyOpts
func WithPolicies ¶
func WithPolicies(policies []Policy) TopologyOpts
func WithProgrammedGatewaysOnly ¶ added in v0.10.0
func WithProgrammedGatewaysOnly() TopologyOpts
func WithRoutes ¶
func WithRoutes(routes []*gatewayapiv1.HTTPRoute) TopologyOpts
type Type ¶ added in v0.10.0
type Type interface { GetGVK() schema.GroupVersionKind GetInstance() client.Object }
func NewGatewayType ¶ added in v0.10.0
func NewGatewayType() Type
func NewHTTPRouteType ¶ added in v0.10.0
func NewHTTPRouteType() Type