route

package
v1.6.1-0...-f207c0f Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConditionTypeBackendsProgrammed is a condition type for Routes
	// that indicates whether all backends are programmed.
	ConditionTypeBackendsProgrammed = "BackendsProgrammed"
	// ConditionReasonBackendsProgrammed is a condition reason for Routes
	// that indicates all backends are programmed.
	ConditionReasonBackendsProgrammed = "BackendsProgrammed"
	// ConditionReasonBackendsNotProgrammed is a condition reason for Routes
	// that indicates not all backends are programmed.
	ConditionReasonBackendsNotProgrammed = "BackendsNotProgrammed"
)

Backends-related conditions for Routes

View Source
const (
	// ConditionTypeRoutesProgrammed is a condition type for Routes
	// that indicates whether all routes are programmed to the gateway.
	ConditionTypeRoutesProgrammed = "RoutesProgrammed"
	// ConditionReasonRoutesProgrammed is a condition reason for Routes
	// that indicates all routes are programmed to the gateway.
	ConditionReasonRoutesProgrammed = "RoutesProgrammed"
	// ConditionReasonRoutesNotProgrammed is a condition reason for Routes
	// that indicates not all routes are programmed to the gateway.
	ConditionReasonRoutesNotProgrammed = "RoutesNotProgrammed"
)

Routing-related conditions for Routes

View Source
const HTTPRouteKey = "HTTPRoute"

HTTPRouteKey identifies HTTPRoute resources.

Variables

This section is empty.

Functions

func StatusMapKey

func StatusMapKey(routeKind, routeNN, gatewayNN string) string

StatusMapKey generates a unique key for a route-gateway pair routeKind: "HTTPRoute", "GRPCRoute", etc. routeNN: "namespace/name" of the route gatewayNN: "namespace/name" of the gateway

Types

type RouteObject

type RouteObject interface {
	gwtypes.HTTPRoute | gwtypes.GRPCRoute
}

RouteObject is a constraint for supported route types.

type RouteObjectPtr

type RouteObjectPtr[T RouteObject] interface {
	*T
	client.Object
}

RouteObjectPtr is a constraint for pointers to supported route types.

type RouteStatusUpdater

type RouteStatusUpdater interface {
	// ComputeStatus computes the status of the route object.
	ComputeStatus()
	// EnforceStatus enforces the computed status on the route object.
	EnforceStatus(ctx context.Context) (op.Result, error)
}

RouteStatusUpdater computes and enforces the status of a route object.

func NewRouteStatusUpdater

func NewRouteStatusUpdater[t RouteObject](obj t, cl client.Client, logger logr.Logger, sharedStatusMap *SharedRouteStatusMap) (RouteStatusUpdater, error)

NewRouteStatusUpdater returns a RouteStatusUpdater for the given route object.

type ServiceControllerStatus

type ServiceControllerStatus struct {
	ServiceControllerInit bool
	ProgrammedBackends    int
}

ServiceControllerStatus holds the status of a service as managed by a specific controller

type SharedRouteStatus

type SharedRouteStatus struct {
	Services map[string]ServiceControllerStatus
}

SharedRouteStatus holds the status of services associated with a specific route-gateway pair

type SharedRouteStatusMap

type SharedRouteStatusMap struct {
	sync.RWMutex
	SharedStatus map[string]SharedRouteStatus
}

SharedRouteStatusMap is a thread-safe map to store the status of routes shared across multiple gateways

func NewSharedStatusMap

func NewSharedStatusMap() *SharedRouteStatusMap

NewSharedStatusMap initializes a new SharedRouteStatusMap

func (*SharedRouteStatusMap) GetProgrammedServices

func (s *SharedRouteStatusMap) GetProgrammedServices(key string, serviceNN string) (n int, initiated bool)

GetProgrammedServices retrieves the number of programmed backends and initialization status for a service associated with a specific route-gateway pair

func (*SharedRouteStatusMap) UpdateProgrammedServices

func (s *SharedRouteStatusMap) UpdateProgrammedServices(service corev1.Service, key string, programmedBackends int)

UpdateProgrammedServices updates the status of a service for a specific route-gateway pair

Jump to

Keyboard shortcuts

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