common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplateValidatorImageKey    = "VALIDATOR_IMAGE"
	KubevirtNodeLabellerImageKey = "NODE_LABELLER_IMAGE"
	KvmInfoNfdPluginImageKey     = "KVM_INFO_IMAGE"
	KubevirtCpuNfdPluginImageKey = "CPU_PLUGIN_IMAGE"
	VirtLauncherImageKey         = "VIRT_LAUNCHER_IMAGE"
)

Variables

This section is empty.

Functions

func EnvOrDefault

func EnvOrDefault(envName string, defVal string) string

Types

type ReconcileFunc

type ReconcileFunc = func(*Request) (ResourceStatus, error)

type Request

type Request struct {
	reconcile.Request
	Client       client.Client
	Scheme       *runtime.Scheme
	Context      context.Context
	Instance     *ssp.SSP
	Logger       logr.Logger
	VersionCache VersionCache
}

type ResourceStatus

type ResourceStatus struct {
	Resource     controllerutil.Object
	Progressing  StatusMessage
	NotAvailable StatusMessage
	Degraded     StatusMessage
}

func CollectResourceStatus

func CollectResourceStatus(request *Request, funcs ...ReconcileFunc) ([]ResourceStatus, error)

func CreateOrUpdateClusterResource

func CreateOrUpdateClusterResource(request *Request, resource controllerutil.Object, updateResource ResourceUpdateFunc) (ResourceStatus, error)

func CreateOrUpdateClusterResourceWithStatus

func CreateOrUpdateClusterResourceWithStatus(request *Request, resource controllerutil.Object, updateResource ResourceUpdateFunc, statusFunc ResourceStatusFunc) (ResourceStatus, error)

func CreateOrUpdateResource

func CreateOrUpdateResource(request *Request, resource controllerutil.Object, updateResource ResourceUpdateFunc) (ResourceStatus, error)

func CreateOrUpdateResourceWithStatus

func CreateOrUpdateResourceWithStatus(request *Request, resource controllerutil.Object, updateResource ResourceUpdateFunc, statusFunc ResourceStatusFunc) (ResourceStatus, error)

type ResourceStatusFunc

type ResourceStatusFunc = func(resource controllerutil.Object) ResourceStatus

type ResourceUpdateFunc

type ResourceUpdateFunc = func(expected, found controllerutil.Object)

type StatusMessage

type StatusMessage = *string

type VersionCache

type VersionCache map[cacheKey]cacheValue

func (VersionCache) Add

func (v VersionCache) Add(obj controllerutil.Object)

func (VersionCache) Contains

func (v VersionCache) Contains(obj controllerutil.Object) bool

func (VersionCache) RemoveObj

func (v VersionCache) RemoveObj(obj controllerutil.Object)

Jump to

Keyboard shortcuts

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