mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
Feat(workflow): add apply application workflow step definition (#2186)
This commit is contained in:
@@ -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 & {}
|
||||
|
||||
@@ -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 & {}
|
||||
}
|
||||
Reference in New Issue
Block a user