key

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForController

func ForController(obj client.Object) (string, error)

ForController returns a ring key for the controller of the given object. It returns an empty key if the object doesn't have an ownerReference with controller=true".

func ForObject

func ForObject(obj client.Object) (string, error)

ForObject returns a ring key for the given object itself. It needs the TypeMeta (GVK) to be set, which is not set on objects after decoding by default.

Types

type Func

type Func func(client.Object) (string, error)

Func maps objects to hash keys. It returns an error if the prerequisites for sharding the given object are not fulfilled. If the returned key is empty, the object should not be assigned.

func FuncForResource

func FuncForResource(gr metav1.GroupResource, ring *shardingv1alpha1.ControllerRing) (Func, error)

FuncForResource returns the key function that maps the given resource or its controller depending on whether the resource is listed as a resource or controlled resource in the given ring.

Jump to

Keyboard shortcuts

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