envbinding

package
v1.1.0-rc.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssembleEnvBindApps

func AssembleEnvBindApps(envBindApps []*EnvBindApp) error

AssembleEnvBindApps assemble resource for EnvBindApp

func PatchComponent

func PatchComponent(baseComponent *common.ApplicationComponent, patchComponent *common.ApplicationComponent) (*common.ApplicationComponent, error)

PatchComponent patch component parameter to target component parameter

func PatchProperties

func PatchProperties(dst runtime.RawExtension, patch runtime.RawExtension) (map[string]interface{}, error)

PatchProperties merge patch parameter for dst parameter

func RenderEnvBindApps

func RenderEnvBindApps(ctx context.Context, envBindApps []*EnvBindApp, appParser *appfile.Parser) error

RenderEnvBindApps render EnvBindApps

func Setup

func Setup(mgr ctrl.Manager, args oamctrl.Args) error

Setup adds a controller that reconciles EnvBinding.

func StoreManifest2ConfigMap

func StoreManifest2ConfigMap(ctx context.Context, cli client.Client, envBinding *v1alpha1.EnvBinding, apps []*EnvBindApp) error

StoreManifest2ConfigMap store manifest to configmap

Types

type ClusterManagerEngine

type ClusterManagerEngine interface {
	Prepare(ctx context.Context, configs []v1alpha1.EnvConfig) error
	Schedule(ctx context.Context, apps []*EnvBindApp) error
	GetClusterDecisions() []v1alpha1.ClusterDecision
}

ClusterManagerEngine defines Cluster Manage interface

func NewOCMEngine

func NewOCMEngine(cli client.Client, appName, appNs string) ClusterManagerEngine

NewOCMEngine create Open-Cluster-Management ClusterManagerEngine

type EnvBindApp

type EnvBindApp struct {
	ManifestWork map[string]*unstructured.Unstructured
	// contains filtered or unexported fields
}

EnvBindApp describes the app bound to the environment

func CreateEnvBindApps

func CreateEnvBindApps(envBinding *v1alpha1.EnvBinding, baseApp *v1beta1.Application) ([]*EnvBindApp, error)

CreateEnvBindApps create EnvBindApps from different envs

func NewEnvBindApp

func NewEnvBindApp(base *v1beta1.Application, envConfig *v1alpha1.EnvConfig) *EnvBindApp

NewEnvBindApp create EnvBindApp

func (*EnvBindApp) SetNamespace

func (e *EnvBindApp) SetNamespace(resource *unstructured.Unstructured)

SetNamespace set namespace for *unstructured.Unstructured

func (*EnvBindApp) SetTraitName

func (e *EnvBindApp) SetTraitName(compName string, trait *unstructured.Unstructured)

SetTraitName set name for Trait

type OCMEngine

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

OCMEngine represents Open-Cluster-Management multi-cluster management solution

func (*OCMEngine) DispatchPlacement

func (o *OCMEngine) DispatchPlacement(ctx context.Context, config v1alpha1.EnvConfig) error

DispatchPlacement dispatch Placement Object of OCM for cluster selected

func (*OCMEngine) GetClusterDecisions

func (o *OCMEngine) GetClusterDecisions() []v1alpha1.ClusterDecision

GetClusterDecisions return ClusterDecisions

func (*OCMEngine) GetSelectedCluster

func (o *OCMEngine) GetSelectedCluster(ctx context.Context, name, namespace string) (string, error)

GetSelectedCluster get selected cluster from PlacementDecision

func (*OCMEngine) Prepare

func (o *OCMEngine) Prepare(ctx context.Context, configs []v1alpha1.EnvConfig) error

Prepare complete the pre-work of cluster scheduling and select the target cluster 1) if user directly specify the cluster name, Prepare will do nothing 2) if user use Labels to select the target cluster, Prepare will create the Placement to select cluster

func (*OCMEngine) Schedule

func (o *OCMEngine) Schedule(ctx context.Context, apps []*EnvBindApp) error

Schedule decides which cluster the apps is scheduled to

type Reconciler

type Reconciler struct {
	client.Client

	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

Reconciler reconciles a EnvBinding object

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is the main logic for EnvBinding controller

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager will setup with event recorder

Jump to

Keyboard shortcuts

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