Documentation ¶
Index ¶
- func HandleCheckManageWorkloadTrait(appRev v1beta1.ApplicationRevision, comps []*types.ComponentManifest)
- func PrepareBeforeApply(comp *types.ComponentManifest, appRev *v1beta1.ApplicationRevision, ...) (*unstructured.Unstructured, []*unstructured.Unstructured, error)
- type WorkloadOption
- type WorkloadOptionFn
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 ¶
func PrepareBeforeApply(comp *types.ComponentManifest, appRev *v1beta1.ApplicationRevision, workloadOpt []WorkloadOption) (*unstructured.Unstructured, []*unstructured.Unstructured, error)
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 ¶
type WorkloadOptionFn func(*unstructured.Unstructured, *v1beta1.ComponentDefinition, []*unstructured.Unstructured) error
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