committer

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 4 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStatuslessCommitter added in v0.11.0

func NewStatuslessCommitter[R StatuslessResource, P Patcher[R]](patcher ClusterPatcher[R, P], shallowCopy ObjectMetaShallowCopy[R]) func(context.Context, R, R) error

NewStatuslessCommitter returns a function that can patch instances of status-less R.

func NewStatuslessCommitterScoped added in v0.11.0

func NewStatuslessCommitterScoped[R StatuslessResource](patcher Patcher[R], shallowCopy ObjectMetaShallowCopy[R]) func(context.Context, R, R) error

NewStatuslessCommitterScoped returns a function that can patch instances of status-less R changes using a scoped patcher.

func ShallowCopy added in v0.11.0

func ShallowCopy[R any](obj *R) *R

ShallowCopy does a shallow copy using Golang's default assignment operator.

Types

type ClusterPatcher added in v0.10.0

type ClusterPatcher[R runtime.Object, P Patcher[R]] interface {
	Cluster(cluster logicalcluster.Path) P
}

ClusterPatcher is just the cluster-aware Patch API with a generic to keep use sites type safe.

type CommitFunc added in v0.11.0

type CommitFunc[Sp any, St any] func(_ context.Context, old *Resource[Sp, St], new *Resource[Sp, St]) error

CommitFunc is an alias to clean up type declarations.

func NewCommitter

func NewCommitter[R runtime.Object, P Patcher[R], Sp any, St any](patcher ClusterPatcher[R, P]) CommitFunc[Sp, St]

NewCommitter returns a function that can patch instances of R based on meta, spec or status changes using a cluster-aware patcher.

func NewCommitterScoped added in v0.10.0

func NewCommitterScoped[R runtime.Object, P Patcher[R], Sp any, St any](patcher Patcher[R]) CommitFunc[Sp, St]

NewCommitterScoped returns a function that can patch instances of R based on meta, spec or status changes using a patcher scoped to a specific cluster.

func NewSSACommitter added in v0.31.0

func NewSSACommitter[R runtime.Object, P Patcher[R], Sp any, St any](patcher ClusterPatcher[R, P], fieldManager string) CommitFunc[Sp, St]

type ObjectMetaShallowCopy added in v0.11.0

type ObjectMetaShallowCopy[R any] func(obj R) R

ObjectMetaShallowCopy copies the object such that the ObjectMeta is a shallow copy that can be mutated without mutating the input object.

type Patcher

type Patcher[R runtime.Object] interface {
	Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (R, error)
}

Patcher is just the Patch API with a generic to keep use sites type safe.

type Resource

type Resource[Sp any, St any] struct {
	APIVersion        string `json:"apiVersion,omitempty"`
	Kind              string `json:"kind,omitempty"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Sp `json:"spec,omitempty"`
	Status            St `json:"status,omitempty"`
}

Resource is a generic wrapper around resources so we can generate patches.

type StatuslessResource added in v0.11.0

type StatuslessResource interface {
	runtime.Object
	metav1.Object
}

Jump to

Keyboard shortcuts

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