Feat(workflow): add apply application workflow step definition (#2186)

This commit is contained in:
Tianxin Dong
2021-08-31 20:21:29 +08:00
committed by GitHub
parent 7a139b554f
commit 2d1edbb16d
3 changed files with 51 additions and 0 deletions
@@ -0,0 +1,20 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-application.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply application for your workflow steps
name: apply-application
namespace: {{.Values.systemDefinitionNamespace}}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
// apply application
output: op.#ApplyApplication & {}
+17
View File
@@ -15,6 +15,23 @@ import (
#Apply: kube.#Apply
#ApplyApplication: #Steps & {
load: ws.#Load @step(1)
components: #Steps & {
for name, c in load.value {
"\(name)": #Steps & {
workload: kube.#Apply & {value: c.workload}
if c.auxiliaries != _|_ {
_key: "trait.oam.dev/resource"
for index, o in c.auxiliaries {
"\(o.metadata.labels[_key])": kube.#Apply & {value: o}
}
}
}
}
} @step(2)
}
#ApplyComponent: #Steps & {
component: string
@@ -0,0 +1,14 @@
import (
"vela/op"
)
"apply-application": {
type: "workflow-step"
annotations: {}
labels: {}
description: "Apply application for your workflow steps"
}
template: {
// apply application
output: op.#ApplyApplication & {}
}