reports

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayCondition

type GatewayCondition struct {
	Type    gwv1.GatewayConditionType
	Status  metav1.ConditionStatus
	Reason  gwv1.GatewayConditionReason
	Message string
}

type GatewayReport

type GatewayReport struct {
	// contains filtered or unexported fields
}

func (*GatewayReport) GetConditions

func (g *GatewayReport) GetConditions() []metav1.Condition

func (*GatewayReport) Listener

func (g *GatewayReport) Listener(listener *gwv1.Listener) ListenerReporter

func (*GatewayReport) SetCondition

func (g *GatewayReport) SetCondition(gc GatewayCondition)

type GatewayReporter

type GatewayReporter interface {
	Listener(listener *gwv1.Listener) ListenerReporter
	SetCondition(condition GatewayCondition)
}

type ListenerCondition

type ListenerCondition struct {
	Type    gwv1.ListenerConditionType
	Status  metav1.ConditionStatus
	Reason  gwv1.ListenerConditionReason
	Message string
}

type ListenerReport

type ListenerReport struct {
	Status gwv1.ListenerStatus
}

func NewListenerReport

func NewListenerReport(name string) *ListenerReport

func (*ListenerReport) SetAttachedRoutes

func (l *ListenerReport) SetAttachedRoutes(n uint)

func (*ListenerReport) SetCondition

func (l *ListenerReport) SetCondition(lc ListenerCondition)

func (*ListenerReport) SetSupportedKinds

func (l *ListenerReport) SetSupportedKinds(rgks []gwv1.RouteGroupKind)

type ListenerReporter

type ListenerReporter interface {
	SetCondition(ListenerCondition)
	SetSupportedKinds([]gwv1.RouteGroupKind)
	SetAttachedRoutes(n uint)
}

type ParentRefKey

type ParentRefKey struct {
	Group string
	Kind  string
	types.NamespacedName
}

type ParentRefReport

type ParentRefReport struct {
	Conditions []metav1.Condition
}

TODO: rename to e.g. RouteParentRefReport

func (*ParentRefReport) SetCondition

func (prr *ParentRefReport) SetCondition(rc RouteCondition)

type ParentRefReporter

type ParentRefReporter interface {
	SetCondition(condition RouteCondition)
}

type ReportMap

type ReportMap struct {
	Gateways   map[types.NamespacedName]*GatewayReport
	HTTPRoutes map[types.NamespacedName]*RouteReport
	TCPRoutes  map[types.NamespacedName]*RouteReport
}

func NewReportMap

func NewReportMap() ReportMap

func (*ReportMap) BuildGWStatus

func (r *ReportMap) BuildGWStatus(ctx context.Context, gw gwv1.Gateway) *gwv1.GatewayStatus

func (*ReportMap) BuildRouteStatus

func (r *ReportMap) BuildRouteStatus(ctx context.Context, obj client.Object, cName string) *gwv1.RouteStatus

BuildRouteStatus returns a newly constructed and fully defined RouteStatus for the supplied route object according to the state of the ReportMap. If the ReportMap does not have a RouteReport for the given route, e.g. because it did not encounter the route during translation, or the object is an unsupported route kind, nil is returned. Supported object types are:

* HTTPRoute * TCPRoute

func (*ReportMap) Gateway

func (r *ReportMap) Gateway(gateway *gwv1.Gateway) *GatewayReport

Returns a GatewayReport for the provided Gateway, nil if there is not a report present. This is different than the Reporter.Gateway() method, as we need to understand when reports are not generated for a Gateway that has been translated.

NOTE: Exported for unit testing, validation_test.go should be refactored to reduce this visibility

type Reporter

type Reporter interface {
	Gateway(gateway *gwv1.Gateway) GatewayReporter
	Route(obj client.Object) RouteReporter
}

func NewReporter

func NewReporter(reportMap *ReportMap) Reporter

type RouteCondition added in v1.18.0

type RouteCondition struct {
	Type    gwv1.RouteConditionType
	Status  metav1.ConditionStatus
	Reason  gwv1.RouteConditionReason
	Message string
}

type RouteReport

type RouteReport struct {
	Parents map[ParentRefKey]*ParentRefReport
	// contains filtered or unexported fields
}

func (*RouteReport) ParentRef

func (r *RouteReport) ParentRef(parentRef *gwv1.ParentReference) ParentRefReporter

type RouteReporter added in v1.18.0

type RouteReporter interface {
	ParentRef(parentRef *gwv1.ParentReference) ParentRefReporter
}

Jump to

Keyboard shortcuts

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