helper

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 8 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 SuffixObjectKeyName

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

Types

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 OwnerInOtherNamespaceError

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

func (*OwnerInOtherNamespaceError) Error

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