framework

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlwaysTrueComparator added in v0.3.0

func AlwaysTrueComparator() func(deployed resource.KubernetesResource, requested resource.KubernetesResource) bool

AlwaysTrueComparator returns a comparator that always return 'true'. can be used on use cases where we want to create if not exists, but not update

func Fetch added in v0.3.0

func Fetch(client client.Client, key types.NamespacedName, instance resource.KubernetesResource) error

func Key added in v0.3.0

func Key(instance metav1.Object) types.NamespacedName

Key creates a new NamespacedName from a given Kubernetes resource

Types

type ControllerWatcher

type ControllerWatcher interface {
	// Watch add the given objects to the controller watch list
	Watch(objects ...WatchedObjects) (err error)
	// AreAllObjectsWatched verifies if this instance already has registered every required object in the watch list
	AreAllObjectsWatched() bool
	// IsGroupWatched verifies if the given group has it's objects watched or not
	IsGroupWatched(group string) bool
}

ControllerWatcher helps to add required objects to the controller watch list given the required runtime objects

func NewControllerWatcher

func NewControllerWatcher(discoveryClient discovery.DiscoveryInterface, manager controllerruntime.Manager, controller controller.Controller, owner runtime.Object) ControllerWatcher

NewControllerWatcher creates a new ControllerWatcher to control the objects that needed to be watched

type WatchedObjects

type WatchedObjects struct {
	// GroupVersion for the watched objects
	GroupVersion schema.GroupVersion
	// AddToScheme function to register the Scheme to the Kubernetes Client. This will enable the controller to query for those objects during the reconcile loop.
	AddToScheme func(scheme *runtime.Scheme) error
	// Objects list of required objects that should be watched by the controller
	Objects []runtime.Object
	// Owner of the object if different from the actual controller
	Owner runtime.Object
}

WatchedObjects objects that the controller supposed to watch for

Jump to

Keyboard shortcuts

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