clientutil

package
v0.0.0-...-84d2bf4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreAlreadyExists

func IgnoreAlreadyExists(err error) error

IgnoreAlreadyExists returns nil on IsAlreadyExists errors.

Types

type OperationResult

type OperationResult string

OperationResult is the action result of a CreateOrUpdate call

const (
	// OperationResultNone means that the resource has not been changed
	OperationResultNone OperationResult = "unchanged"
	// OperationResultCreated means that a new resource is created
	OperationResultCreated OperationResult = "created"
	// OperationResultUpdated means that an existing resource is updated
	OperationResultUpdated OperationResult = "updated"
)

func CreateOrPatch

func CreateOrPatch(ctx context.Context, c client.Client, obj client.Object, mutate func() error) (OperationResult, error)

func Patch

func Patch(ctx context.Context, c client.Client, obj client.Object, mutate func() error) (OperationResult, error)

func PatchStatus

func PatchStatus(ctx context.Context, c client.Client, obj client.Object, mutate func() error) (OperationResult, error)

Jump to

Keyboard shortcuts

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