github.com/oam-dev/kubevela@v1.9.11/charts/vela-core/templates/defwithtemplate/deploy2runtime.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/deprecated/deploy2runtime.cue
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: WorkflowStepDefinition
     5  metadata:
     6    annotations:
     7      definition.oam.dev/description: Deploy application to runtime clusters
     8    labels:
     9      custom.definition.oam.dev/deprecated: "true"
    10      custom.definition.oam.dev/scope: Application
    11      custom.definition.oam.dev/ui-hidden: "true"
    12    name: deploy2runtime
    13    namespace: {{ include "systemDefinitionNamespace" . }}
    14  spec:
    15    schematic:
    16      cue:
    17        template: |
    18          import (
    19          	"vela/op"
    20          )
    21  
    22          app: op.#Steps & {
    23          	load: op.#Load
    24          	clusters: [...string]
    25          	if parameter.clusters == _|_ {
    26          		listClusters: op.#ListClusters
    27          		clusters:     listClusters.outputs.clusters
    28          	}
    29          	if parameter.clusters != _|_ {
    30          		clusters: parameter.clusters
    31          	}
    32  
    33          	apply: op.#Steps & {
    34          		for _, cluster_ in clusters {
    35          			for name, c in load.value {
    36          				"\(cluster_)-\(name)": op.#ApplyComponent & {
    37          					value:   c
    38          					cluster: cluster_
    39          				}
    40          			}
    41          		}
    42          	}
    43          }
    44  
    45          parameter: {
    46          	// +usage=Declare the runtime clusters to apply, if empty, all runtime clusters will be used
    47          	clusters?: [...string]
    48          }
    49