helper

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(target metav1.Object, name string) bool

func Annotate

func Annotate(target metav1.Object, name, value string) bool

func CopyLabelsAndAnnotations

func CopyLabelsAndAnnotations(target, src metav1.Object)

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, cl client.Client, obj client.Object, opts ...CreateOrUpdateOption) error

func DeleteIgnoreNotFound

func DeleteIgnoreNotFound(ctx context.Context, cl client.Client, obj client.Object, opts ...lifecycle.DeleteOption) (bool, error)

func Exists

func Exists(obj client.Object) bool

func GetIgnoreNotFound

func GetIgnoreNotFound(ctx context.Context, cl client.Client, key client.ObjectKey, obj client.Object) (bool, error)

func Label

func Label(target metav1.Object, name, value string) bool

func Own

func Own(target client.Object, owner lifecycle.TypedObject) error

func OwnUncontrolled added in v0.2.0

func OwnUncontrolled(target client.Object, owner lifecycle.TypedObject) error

func Patch

func Patch(ctx context.Context, cl client.Client, upd, orig client.Object, opts ...PatchOption) error

func RemoveFinalizer

func RemoveFinalizer(target metav1.Object, name string) bool

func SuffixObjectKey added in v0.6.4

func SuffixObjectKey(key client.ObjectKey, suffix string) client.ObjectKey

func SuffixObjectKeyName

func SuffixObjectKeyName(key client.ObjectKey, suffix string) client.ObjectKey

Types

type ClusterScopedAPIObject added in v0.4.0

type ClusterScopedAPIObject struct {
	// contains filtered or unexported fields
}

ClusterScopedAPIObject allows an arbitrary Kubernetes object to be represented using the lifecycle constructs or embedded into a specific type.

func ForClusterScopedAPIObject added in v0.4.0

func ForClusterScopedAPIObject(name *string, obj lifecycle.TypedObject) *ClusterScopedAPIObject

ForClusterScopedAPIObject creates a lifecycle-compatible representation of a Kubernetes object that will automatically reflect changes back to the given arguments.

func (*ClusterScopedAPIObject) AddFinalizer added in v0.4.0

func (ao *ClusterScopedAPIObject) AddFinalizer(ctx context.Context, name string) bool

func (*ClusterScopedAPIObject) Delete added in v0.4.0

func (*ClusterScopedAPIObject) Finalizing added in v0.4.0

func (ao *ClusterScopedAPIObject) Finalizing() bool

func (*ClusterScopedAPIObject) LabelAnnotateFrom added in v0.4.0

func (ao *ClusterScopedAPIObject) LabelAnnotateFrom(ctx context.Context, from metav1.Object)

func (*ClusterScopedAPIObject) Load added in v0.4.0

func (*ClusterScopedAPIObject) Own added in v0.4.0

func (*ClusterScopedAPIObject) Owned added in v0.4.0

func (*ClusterScopedAPIObject) Persist added in v0.4.0

func (*ClusterScopedAPIObject) RemoveFinalizer added in v0.4.0

func (ao *ClusterScopedAPIObject) RemoveFinalizer(ctx context.Context, name string) bool

type CreateOrUpdateOption

type CreateOrUpdateOption interface {
	ApplyToCreateOrUpdateOptions(target *CreateOrUpdateOptions)
}

type CreateOrUpdateOptions

type CreateOrUpdateOptions struct {
	ObjectKey client.ObjectKey
}

func (*CreateOrUpdateOptions) ApplyOptions

func (o *CreateOrUpdateOptions) ApplyOptions(opts []CreateOrUpdateOption)

type NamespaceScopedAPIObject added in v0.4.0

type NamespaceScopedAPIObject struct {
	// contains filtered or unexported fields
}

NamespaceScopedAPIObject allows an arbitrary Kubernetes object to be represented using the lifecycle constructs or embedded into a specific type.

func ForNamespaceScopedAPIObject added in v0.4.0

func ForNamespaceScopedAPIObject(key *client.ObjectKey, obj lifecycle.TypedObject) *NamespaceScopedAPIObject

ForNamespaceScopedAPIObject creates a lifecycle-compatible representation of a Kubernetes object that will automatically reflect changes back to the given arguments.

func (*NamespaceScopedAPIObject) AddFinalizer added in v0.4.0

func (ao *NamespaceScopedAPIObject) AddFinalizer(ctx context.Context, name string) bool

func (*NamespaceScopedAPIObject) Delete added in v0.4.0

func (*NamespaceScopedAPIObject) Finalizing added in v0.4.0

func (ao *NamespaceScopedAPIObject) Finalizing() bool

func (*NamespaceScopedAPIObject) LabelAnnotateFrom added in v0.4.0

func (ao *NamespaceScopedAPIObject) LabelAnnotateFrom(ctx context.Context, from metav1.Object)

func (*NamespaceScopedAPIObject) Load added in v0.4.0

func (*NamespaceScopedAPIObject) Own added in v0.4.0

func (*NamespaceScopedAPIObject) Owned added in v0.4.0

func (*NamespaceScopedAPIObject) Persist added in v0.4.0

func (*NamespaceScopedAPIObject) RemoveFinalizer added in v0.4.0

func (ao *NamespaceScopedAPIObject) RemoveFinalizer(ctx context.Context, name string) bool

type OwnerInOtherNamespaceError

type OwnerInOtherNamespaceError struct {
	Owner  lifecycle.TypedObject
	Target client.Object
}

func (*OwnerInOtherNamespaceError) Error

type OwnerNotPersistedError added in v0.4.0

type OwnerNotPersistedError struct {
	Owner  lifecycle.TypedObject
	Target client.Object
}

func (*OwnerNotPersistedError) Error added in v0.4.0

func (e *OwnerNotPersistedError) Error() string

type PatchOption

type PatchOption interface {
	ApplyToPatchOptions(target *PatchOptions)
}

type PatchOptions

type PatchOptions struct {
	ObjectKey client.ObjectKey
}

func (*PatchOptions) ApplyOptions

func (o *PatchOptions) ApplyOptions(opts []PatchOption)

type Patcher

type Patcher struct {
	// contains filtered or unexported fields
}

func NewPatcher

func NewPatcher(upd, orig client.Object, opts ...PatchOption) *Patcher

func (*Patcher) Persist

func (p *Patcher) Persist(ctx context.Context, cl client.Client) error

type WithObjectKey

type WithObjectKey client.ObjectKey

func (WithObjectKey) ApplyToCreateOrUpdateOptions

func (wok WithObjectKey) ApplyToCreateOrUpdateOptions(opts *CreateOrUpdateOptions)

func (WithObjectKey) ApplyToPatchOptions

func (wok WithObjectKey) ApplyToPatchOptions(opts *PatchOptions)

Jump to

Keyboard shortcuts

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