github.com/kubevela/workflow@v0.6.0/charts/vela-workflow/templates/definitions/apply-deployment.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/apply-deployment.cue
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: WorkflowStepDefinition
     5  metadata:
     6    annotations:
     7      definition.oam.dev/alias: ""
     8      definition.oam.dev/description: Apply deployment with specified image and cmd.
     9    name: apply-deployment
    10    namespace: {{ include "systemDefinitionNamespace" . }}
    11  spec:
    12    schematic:
    13      cue:
    14        template: |
    15          import (
    16          	"strconv"
    17          	"strings"
    18          	"vela/op"
    19          )
    20  
    21          output: op.#Apply & {
    22          	value: {
    23          		apiVersion: "apps/v1"
    24          		kind:       "Deployment"
    25          		metadata: {
    26          			name:      context.stepName
    27          			namespace: context.namespace
    28          		}
    29          		spec: {
    30          			selector: matchLabels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
    31          			template: {
    32          				metadata: labels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
    33          				spec: containers: [{
    34          					name:  context.stepName
    35          					image: parameter.image
    36          					if parameter["cmd"] != _|_ {
    37          						command: parameter.cmd
    38          					}
    39          				}]
    40          			}
    41          		}
    42          	}
    43          }
    44          wait: op.#ConditionalWait & {
    45          	continue: output.value.status != _|_ && output.value.status.updatedReplicas == output.value.status.availableReplicas && output.value.status.observedGeneration == output.value.metadata.generation
    46          }
    47          parameter: {
    48          	image: string
    49          	cmd?: [...string]
    50          }
    51