k8s

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

type Operation string

Operation indicates the type of operation performed by an upsert.

const (
	// OperationCreated indicates that an upsert created the resource.
	OperationCreated Operation = "created"
	// OperationUpdated indicates that an upsert updated the resource.
	OperationUpdated Operation = "updated"
)

func Upsert

func Upsert[R Upsertable[R]](
	ctx context.Context, client client.Client, resource R,
) (Operation, error)

Upsert creates a new resource with the given specification if it does not yet exist in the cluster and updates the existing resource otherwise.

type Upsertable

type Upsertable[T any] interface {
	client.Object
	DeepCopy() T
	DeepCopyInto(T)
}

Upsertable describes a Kubernetes resource which can be created or updated.

Jump to

Keyboard shortcuts

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