sharder

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControllerRingForRequest added in v0.10.0

func ControllerRingForRequest(ctx context.Context, c client.Reader) (*shardingv1alpha1.ControllerRing, error)

ControllerRingForRequest returns the Ring object matching the requests' path.

func ControllerRingForWebhookPath added in v0.10.0

func ControllerRingForWebhookPath(requestPath string) (*shardingv1alpha1.ControllerRing, error)

ControllerRingForWebhookPath returns the ControllerRing that is associated with the given webhook handler path. It is the reverse of WebhookPathForControllerRing.

func NewContextWithRequestPath

func NewContextWithRequestPath(ctx context.Context, r *http.Request) context.Context

NewContextWithRequestPath augments the given context with the request's path.

func RequestPathFromContext

func RequestPathFromContext(ctx context.Context) (string, error)

RequestPathFromContext returns the request's path stored in the given context.

func WebhookPathForControllerRing added in v0.10.0

func WebhookPathForControllerRing(ring *shardingv1alpha1.ControllerRing) string

WebhookPathForControllerRing returns the webhook handler path that should be used for implementing the given ControllerRing. It is the reverse of ControllerRingForWebhookPath.

Types

type Handler

type Handler struct {
	Reader client.Reader
	Clock  clock.PassiveClock

	Metrics Metrics
}

Handler handles admission requests and invalidates the static token in Secret resources related to ServiceAccounts.

func (*Handler) AddToManager

func (h *Handler) AddToManager(mgr manager.Manager) error

AddToManager adds Handler to the given manager.

func (*Handler) Handle

type Metrics added in v0.10.0

type Metrics interface {
	ObserveAssignment(controllerRingName string, gr metav1.GroupResource)
}

Jump to

Keyboard shortcuts

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