github.com/kubevela/workflow@v0.6.0/controllers/testdata/test-apply.yaml (about) 1 apiVersion: core.oam.dev/v1beta1 2 kind: WorkflowStepDefinition 3 metadata: 4 name: test-apply 5 namespace: vela-system 6 spec: 7 schematic: 8 cue: 9 template: "import (\t\"vela/op\"\n)\n\noutput: op.#Apply & {\n\tvalue: {\n\t\tapiVersion: 10 \"apps/v1\"\n\t\tkind: \"Deployment\"\n\t\tmetadata: {\n\t\t\tname: 11 \ context.stepName\n\t\t\tnamespace: context.namespace\n\t\t}\n\t\tspec: 12 {\n\t\t\tselector: matchLabels: wr: context.stepName\n\t\t\ttemplate: {\n\t\t\t\tmetadata: 13 labels: wr: context.stepName\n\t\t\t\tspec: containers: [{\n\t\t\t\t\tname: 14 \ context.stepName\n\t\t\t\t\timage: parameter.image\n\t\t\t\t\tif parameter[\"cmd\"] 15 != _|_ {\n\t\t\t\t\t\tcommand: parameter.cmd\n\t\t\t\t\t}\n\t\t\t\t\tif parameter[\"message\"] 16 != _|_ {\n\t\t\t\t\t\tenv: [{\n\t\t\t\t\t\t\tname: \"MESSAGE\"\n\t\t\t\t\t\t\tvalue: 17 parameter.message\n\t\t\t\t\t\t}]\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t}\n\t\t}\n\t}\n}\nwait: 18 op.#ConditionalWait & {\n\tcontinue: output.value.status.readyReplicas == 19 1\n}\nparameter: {\n\timage: string\n\tcmd?: [...string]\n\tmessage?: string\n}\n"