Documentation ¶
Index ¶
- func NewStatuslessCommitter[R StatuslessResource, P Patcher[R]](patcher ClusterPatcher[R, P], shallowCopy ObjectMetaShallowCopy[R]) func(context.Context, R, R) error
- func NewStatuslessCommitterScoped[R StatuslessResource](patcher Patcher[R], shallowCopy ObjectMetaShallowCopy[R]) func(context.Context, R, R) error
- func ShallowCopy[R any](obj *R) *R
- type ClusterPatcher
- type CommitFunc
- type ObjectMetaShallowCopy
- type Patcher
- type Resource
- type StatuslessResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStatuslessCommitter ¶
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 ¶
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 ¶
func ShallowCopy[R any](obj *R) *R
ShallowCopy does a shallow copy using Golang's default assignment operator.
Types ¶
type ClusterPatcher ¶
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 ¶
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 ¶
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.
type ObjectMetaShallowCopy ¶
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.