github.com/kubevela/workflow@v0.6.0/charts/vela-workflow/templates/definitions/clean-jobs.yaml (about) 1 # Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file. 2 # Definition source cue file: vela-templates/definitions/internal/clean-jobs.cue 3 apiVersion: core.oam.dev/v1beta1 4 kind: WorkflowStepDefinition 5 metadata: 6 annotations: 7 definition.oam.dev/description: clean applied jobs in the cluster 8 name: clean-jobs 9 namespace: {{ include "systemDefinitionNamespace" . }} 10 spec: 11 schematic: 12 cue: 13 template: | 14 import ( 15 "vela/op" 16 ) 17 18 parameter: { 19 labelselector?: {...} 20 namespace: *context.namespace | string 21 } 22 cleanJobs: op.#Delete & { 23 value: { 24 apiVersion: "batch/v1" 25 kind: "Job" 26 metadata: { 27 name: context.name 28 namespace: parameter.namespace 29 } 30 } 31 filter: { 32 namespace: parameter.namespace 33 if parameter.labelselector != _|_ { 34 matchingLabels: parameter.labelselector 35 } 36 if parameter.labelselector == _|_ { 37 matchingLabels: "workflow.oam.dev/name": context.name 38 } 39 } 40 } 41 cleanPods: op.#Delete & { 42 value: { 43 apiVersion: "v1" 44 kind: "pod" 45 metadata: { 46 name: context.name 47 namespace: parameter.namespace 48 } 49 } 50 filter: { 51 namespace: parameter.namespace 52 if parameter.labelselector != _|_ { 53 matchingLabels: parameter.labelselector 54 } 55 if parameter.labelselector == _|_ { 56 matchingLabels: "workflow.oam.dev/name": context.name 57 } 58 } 59 } 60