assemble

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCheckManageWorkloadTrait

func HandleCheckManageWorkloadTrait(appRev v1beta1.ApplicationRevision, comps []*types.ComponentManifest)

HandleCheckManageWorkloadTrait will checkout every trait whether a manage-workload trait, if yes set label and annotation in trait

func PrepareBeforeApply

PrepareBeforeApply will prepare for some necessary info before apply

Types

type WorkloadOption

type WorkloadOption interface {
	ApplyToWorkload(*unstructured.Unstructured, *v1beta1.ComponentDefinition, []*unstructured.Unstructured) error
}

WorkloadOption will be applied to each workloads AFTER it has been assembled by generic rules shown below: 1) use component name as workload name 2) use application namespace as workload namespace if unspecified 3) set application as workload's owner 4) pass all application's labels and annotations to workload's Component and ComponentDefinition are enough for caller to manipulate workloads. Caller can use below labels of workload to get more information: - oam.LabelAppName - oam.LabelAppRevision - oam.LabelAppRevisionHash - oam.LabelAppComponent - oam.LabelAppComponentRevision

func DiscoveryHelmBasedWorkload

func DiscoveryHelmBasedWorkload(ctx context.Context, c client.Reader) WorkloadOption

DiscoveryHelmBasedWorkload only works for Helm-based component. It computes a qualifiedFullName for the workload and try to get it from K8s cluster. If not found, block down-streaming process until Helm creates the workload successfully.

type WorkloadOptionFn

WorkloadOptionFn implement interface WorkloadOption

func (WorkloadOptionFn) ApplyToWorkload

func (fn WorkloadOptionFn) ApplyToWorkload(wl *unstructured.Unstructured,
	compDefinition *v1beta1.ComponentDefinition, packagedWorkloadResources []*unstructured.Unstructured) error

ApplyToWorkload will apply the manipulation defined in the function to assembled workload

Jump to

Keyboard shortcuts

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