apply

package
v0.0.0-...-5241e9a Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 37 Imported by: 17

Documentation

Index

Constants

View Source
const (
	LabelPrefix = "apply.acorn.io/"

	LabelSubContext = LabelPrefix + "owner-sub-context"
	LabelGVK        = LabelPrefix + "owner-gvk"
	LabelName       = LabelPrefix + "owner-name"
	LabelNamespace  = LabelPrefix + "owner-namespace"
	LabelHash       = LabelPrefix + "hash"

	AnnotationPrune  = LabelPrefix + "prune"
	AnnotationCreate = LabelPrefix + "create"
	AnnotationUpdate = LabelPrefix + "update"
)
View Source
const (
	LabelApplied = "apply.acorn.io/applied"
)

Variables

View Source
var (
	ErrOwnerNotFound = errors.New("owner not found")
)
View Source
var (
	ErrReplace = errors.New("replace object with changes")
)
View Source
var (
	LogInfo func(format string, args ...interface{})
)

Functions

func AddValidOwnerChange

func AddValidOwnerChange(oldSubcontext, newSubContext string)

func Ensure

func Ensure(ctx context.Context, client kclient.Client, obj ...kclient.Object) error

func GetLabelsAndAnnotations

func GetLabelsAndAnnotations(scheme *runtime.Scheme, ownerSubContext string, owner kclient.Object) (map[string]string, map[string]string, error)

func GetSelector

func GetSelector(labelSet map[string]string) (labels.Selector, error)

Types

type Apply

type Apply interface {
	Ensure(ctx context.Context, obj ...kclient.Object) error
	Apply(ctx context.Context, owner kclient.Object, objs ...kclient.Object) error
	WithOwnerSubContext(ownerSubContext string) Apply
	WithNamespace(ns string) Apply
	WithPruneGVKs(gvks ...schema.GroupVersionKind) Apply
	WithPruneTypes(gvks ...kclient.Object) Apply
	WithNoPrune() Apply

	FindOwner(ctx context.Context, obj kclient.Object) (kclient.Object, error)
	PurgeOrphan(ctx context.Context, obj kclient.Object) error
}

func New

func New(c kclient.Client) Apply

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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