utils

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomizeAffinity

func CustomizeAffinity(a *corev1.Affinity, ba common.BaseApplication)

CustomizeAffinity ...

func CustomizeDeployment added in v0.2.0

func CustomizeDeployment(deploy *appsv1.Deployment, ba common.BaseApplication)

CustomizeDeployment ...

func CustomizeHPA

CustomizeHPA ...

func CustomizeKnativeService

func CustomizeKnativeService(ksvc *servingv1alpha1.Service, ba common.BaseApplication)

CustomizeKnativeService ...

func CustomizePersistence

func CustomizePersistence(statefulSet *appsv1.StatefulSet, ba common.BaseApplication)

CustomizePersistence ...

func CustomizePodSpec

func CustomizePodSpec(pts *corev1.PodTemplateSpec, ba common.BaseApplication)

CustomizePodSpec ...

func CustomizeRoute

func CustomizeRoute(route *routev1.Route, ba common.BaseApplication)

CustomizeRoute ...

func CustomizeService

func CustomizeService(svc *corev1.Service, ba common.BaseApplication)

CustomizeService ...

func CustomizeServiceAccount

func CustomizeServiceAccount(sa *corev1.ServiceAccount, ba common.BaseApplication)

CustomizeServiceAccount ...

func CustomizeServiceMonitor added in v0.2.0

func CustomizeServiceMonitor(sm *prometheusv1.ServiceMonitor, ba common.BaseApplication)

CustomizeServiceMonitor ...

func CustomizeStatefulSet added in v0.2.0

func CustomizeStatefulSet(statefulSet *appsv1.StatefulSet, ba common.BaseApplication)

CustomizeStatefulSet ...

func ErrorIsNoMatchesForKind

func ErrorIsNoMatchesForKind(err error, kind string, version string) bool

ErrorIsNoMatchesForKind ...

func GetWatchNamespaces added in v0.2.0

func GetWatchNamespaces() ([]string, error)

GetWatchNamespaces returns a slice of namespaces the operator should watch based on WATCH_NAMESPSCE value WATCH_NAMESPSCE value could be empty for watching the whole cluster or a comma-separated list of namespaces

func MergeMaps added in v0.2.2

func MergeMaps(maps ...map[string]string) map[string]string

MergeMaps returns a map containing the union of al the key-value pairs from the input maps. The order of the maps passed into the func, defines the importance. e.g. if (keyA, value1) is in map1, and (keyA, value2) is in map2, mergeMaps(map1, map2) would contain (keyA, value2).

func SetCondition

SetCondition ...

func UpdateAppDefinition added in v0.2.0

func UpdateAppDefinition(labels map[string]string, annotations map[string]string, ba common.BaseApplication)

UpdateAppDefinition ...

func Validate added in v0.2.0

func Validate(ba common.BaseApplication) (bool, error)

Validate if the BaseApplication is valid

Types

type ReconcilerBase

type ReconcilerBase struct {
	// contains filtered or unexported fields
}

ReconcilerBase base reconciler with some common behaviour

func NewReconcilerBase

func NewReconcilerBase(client client.Client, scheme *runtime.Scheme, restConfig *rest.Config, recorder record.EventRecorder) ReconcilerBase

NewReconcilerBase creates a new ReconcilerBase

func (*ReconcilerBase) CreateOrUpdate

func (r *ReconcilerBase) CreateOrUpdate(obj metav1.Object, owner metav1.Object, reconcile func() error) error

CreateOrUpdate ...

func (*ReconcilerBase) DeleteResource

func (r *ReconcilerBase) DeleteResource(obj runtime.Object) error

DeleteResource deletes kubernetes resource

func (*ReconcilerBase) DeleteResources

func (r *ReconcilerBase) DeleteResources(resources []runtime.Object) error

DeleteResources ...

func (*ReconcilerBase) GetAppsodyOpConfigMap

func (r *ReconcilerBase) GetAppsodyOpConfigMap(name string, ns string) (*corev1.ConfigMap, error)

GetAppsodyOpConfigMap ...

func (*ReconcilerBase) GetClient

func (r *ReconcilerBase) GetClient() client.Client

GetClient returns client

func (*ReconcilerBase) GetDiscoveryClient

func (r *ReconcilerBase) GetDiscoveryClient() (discovery.DiscoveryInterface, error)

GetDiscoveryClient ...

func (*ReconcilerBase) GetRecorder

func (r *ReconcilerBase) GetRecorder() record.EventRecorder

GetRecorder returns the underlying recorder

func (*ReconcilerBase) IsGroupVersionSupported

func (r *ReconcilerBase) IsGroupVersionSupported(groupVersion string) (bool, error)

IsGroupVersionSupported ...

func (*ReconcilerBase) ManageError

func (r *ReconcilerBase) ManageError(issue error, conditionType common.StatusConditionType, ba common.BaseApplication) (reconcile.Result, error)

ManageError ...

func (*ReconcilerBase) ManageSuccess

func (r *ReconcilerBase) ManageSuccess(conditionType common.StatusConditionType, ba common.BaseApplication) (reconcile.Result, error)

ManageSuccess ...

func (*ReconcilerBase) SetDiscoveryClient

func (r *ReconcilerBase) SetDiscoveryClient(discovery discovery.DiscoveryInterface)

SetDiscoveryClient ...

Jump to

Keyboard shortcuts

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