common

package
v0.0.0-...-4234fb6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCleaner

func NewCleaner(manager ctrl.Manager, name controllername.ControllerNamer, gvrRetriever CleanTypeRetriever) error

NewCleaner creates a cleaner that attempts to delete resources with the labels specified and of the types returned by CleanTypeRetriever

func NewResourceReconciler

func NewResourceReconciler(manager ctrl.Manager, name controllername.ControllerNamer, resources []client.Object, reconcileInterval time.Duration) error

NewResourceReconciler creates a reconciler that continuously ensures that the provided resources are provisioned

Types

type CleanTypeRetriever

type CleanTypeRetriever func(mapper meta.RESTMapper) ([]cleanType, error)

CleanTypeRetriever returns types and labels for the cleaner to remove

func RetrieverEmpty

func RetrieverEmpty() CleanTypeRetriever

RetrieverEmpty is commonly used to start a chain of retriever functions

func RetrieverFromGk

func RetrieverFromGk(labels map[string]string, gks ...schema.GroupKind) CleanTypeRetriever

RetrieverFromGk retrieves a list of group version resources based on group kinds

func RetrieverFromObjs

func RetrieverFromObjs(objs []client.Object, labels map[string]string) CleanTypeRetriever

RetrieverFromObjs retrieves a list of group version resources based on supplied object types

func (CleanTypeRetriever) Add

Add merges the results of two retrievers

func (CleanTypeRetriever) Remove

Remove removes results from the receiver that are present in the supplied retriever

type CompareStrategy

type CompareStrategy int

CompareStrategy determines the comparison strategy between cleanTypes

const (
	Everything   CompareStrategy = iota // compare Everything
	IgnoreLabels                        // ignore labels when comparing
)

type RemoveOpt

type RemoveOpt struct {
	CompareStrat CompareStrategy
}

RemoveOpt is used to configure the removal

Jump to

Keyboard shortcuts

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