common

package
v0.11.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OperatorVersionKey = "OPERATOR_VERSION"

	TemplateValidatorImageKey = "VALIDATOR_IMAGE"
)
View Source
const (
	AppKubernetesNameLabel      = "app.kubernetes.io/name"
	AppKubernetesPartOfLabel    = "app.kubernetes.io/part-of"
	AppKubernetesVersionLabel   = "app.kubernetes.io/version"
	AppKubernetesManagedByLabel = "app.kubernetes.io/managed-by"
	AppKubernetesComponentLabel = "app.kubernetes.io/component"
)

Variables

This section is empty.

Functions

func AddAppLabels added in v0.2.0

func AddAppLabels(requestInstance *v1beta1.SSP, name string, component AppComponent, obj client.Object) client.Object

AddAppLabels to the provided obj Name will translate into the AppKubernetesNameLabel Component will translate into the AppKubernetesComponentLabel Instance wide labels will be taken from the request if available

func EnvOrDefault

func EnvOrDefault(envName string, defVal string) string

Types

type AppComponent added in v0.2.0

type AppComponent string
const (
	AppComponentMonitoring AppComponent = "monitoring"
	AppComponentSchedule   AppComponent = "schedule"
	AppComponentTemplating AppComponent = "templating"
)

func (AppComponent) String added in v0.2.0

func (a AppComponent) String() string

type ReconcileBuilder added in v0.2.0

type ReconcileBuilder interface {
	NamespacedResource(client.Object) ReconcileBuilder
	ClusterResource(client.Object) ReconcileBuilder
	WithAppLabels(name string, component AppComponent) ReconcileBuilder
	UpdateFunc(ResourceUpdateFunc) ReconcileBuilder
	StatusFunc(ResourceStatusFunc) ReconcileBuilder

	Reconcile() (ResourceStatus, error)
}

func CreateOrUpdate added in v0.2.0

func CreateOrUpdate(request *Request) ReconcileBuilder

type ReconcileFunc

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

type Request

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

type ResourceStatus

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

func CollectResourceStatus

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

type ResourceStatusFunc

type ResourceStatusFunc = func(resource client.Object) ResourceStatus

type ResourceUpdateFunc

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

type StatusMessage

type StatusMessage = *string

type VersionCache

type VersionCache map[cacheKey]cacheValue

func (VersionCache) Add

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

func (VersionCache) Contains

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

func (VersionCache) RemoveObj

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

Jump to

Keyboard shortcuts

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