apibinding

package
v0.27.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControllerName = "kcp-apibinding"
)
View Source
const (
	// ResourceBindingsAnnotationKey is the key for the annotation on the LogicalCluster
	// to hold ResourceBindings.
	ResourceBindingsAnnotationKey = "internal.apis.kcp.io/resource-bindings"
)

Variables

View Source
var (
	SystemBoundCRDsClusterName = logicalcluster.Name("system:bound-crds")
)

Functions

func InstallIndexers added in v0.25.0

func InstallIndexers(
	apiBindingInformer apisv1alpha1informers.APIBindingClusterInformer,
	apiExportInformer apisv1alpha1informers.APIExportClusterInformer,
	globalAPIExportInformer apisv1alpha1informers.APIExportClusterInformer,
)

InstallIndexers adds the additional indexers that this controller requires to the informers.

func NewController

NewController returns a new controller for APIBindings.

func WithLockedResources added in v0.27.0

WithLockedResources tries to lock the resources for the given binding. It returns those resources that got successfully locked. If a resource is already locked by another binding, it is skipped and returned in the second return value.

The logical cluster is not mutated.

Types

type APIBinding added in v0.8.0

type APIBinding = apisv1alpha1.APIBinding

type APIBindingSpec added in v0.8.0

type APIBindingSpec = apisv1alpha1.APIBindingSpec

type APIBindingStatus added in v0.8.0

type APIBindingStatus = apisv1alpha1.APIBindingStatus

type CommitFunc added in v0.8.0

type CommitFunc = func(context.Context, *Resource, *Resource) error

type ExpirableLock added in v0.27.0

type ExpirableLock struct {
	Lock `json:",inline"`

	// Expiry is an optional timestamp. After that time, the CRD entry is not
	// considered valid anymore IF the object cannot be found.
	CRDExpiry *metav1.Time `json:"e,omitempty"`
}

ExpirableLock is a lock that can expire CRD entries.

type Lock added in v0.27.0

type Lock struct {
	// Name is the name of the APIBinding, or empty.
	Name string `json:"n,omitempty"`
	// CRD is true if the binding is for a CRD.
	CRD bool `json:"c,omitempty"`
}

Lock is a lock for a resource, part of the apis.kcp.io/resource-bindings annotation.

type Patcher added in v0.10.0

type Resource added in v0.8.0

type ResourceBindingsAnnotation added in v0.27.0

type ResourceBindingsAnnotation map[string]ExpirableLock

ResourceBindingsAnnotation is a map of "<resource>.<group>" to bindings. It is stored as a JSON string in the LogicalCluster annotation apis.kcp.io/resource-bindings. It serves as a lock for resources to prevent races of multiple bindings or CRDs owning the same resource.

Jump to

Keyboard shortcuts

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