component

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package component contains component definition

Index

Constants

View Source
const (
	LabelCR          = "custom-resource"
	LabelCRName      = "custom-resource-name"
	LabelCRNamespace = "custom-resource-namespace"
	LabelComponent   = "component"
)

Constants defining labels

View Source
const (
	LifecycleManaged  = "managed"
	LifecycleReferred = "referred"
)

Common const definitions

Variables

This section is empty.

Functions

func Labels

func Labels(cr metav1.Object, component string) map[string]string

Labels return

Types

type Component

type Component struct {
	Handle
	Name     string
	CR       metav1.Object
	OwnerRef *metav1.OwnerReference
}

Component represents a logical collection of resources

func (*Component) Labels

func (c *Component) Labels() map[string]string

Labels return the common labels for a resource

type Handle

type Handle interface {
	DependentResources(rsrc interface{}) *resource.ObjectBag
	ExpectedResources(rsrc interface{}, labels map[string]string, dependent, aggregated *resource.ObjectBag) (*resource.ObjectBag, error)
	Observables(scheme *runtime.Scheme, rsrc interface{}, labels map[string]string, expected *resource.ObjectBag) []resource.Observable
	Mutate(rsrc interface{}, rsrclabels map[string]string, status interface{}, expected, dependent, observed *resource.ObjectBag) (*resource.ObjectBag, error)
	Differs(expected metav1.Object, observed metav1.Object) bool
	UpdateComponentStatus(rsrc, status interface{}, reconciled *resource.ObjectBag, err error)
	Finalize(rsrc, status interface{}, observed *resource.ObjectBag) error
}

Handle is an interface for operating on logical Components of a CR

type KVMap

type KVMap map[string]string

KVMap is a map[string]string

func (KVMap) Merge

func (out KVMap) Merge(kvmaps ...KVMap)

Merge is used to merge multiple maps into the target map

Jump to

Keyboard shortcuts

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