github.com/kubevela/workflow@v0.6.0/charts/vela-workflow/templates/definitions/read-object.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/read-object.cue
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: WorkflowStepDefinition
     5  metadata:
     6    annotations:
     7      definition.oam.dev/description: Read Kubernetes objects from cluster for your workflow steps
     8    labels:
     9      custom.definition.oam.dev/ui-hidden: "true"
    10    name: read-object
    11    namespace: {{ include "systemDefinitionNamespace" . }}
    12  spec:
    13    schematic:
    14      cue:
    15        template: |
    16          import (
    17          	"vela/op"
    18          )
    19  
    20          output: {
    21          	if parameter.apiVersion == _|_ && parameter.kind == _|_ {
    22          		op.#Read & {
    23          			value: {
    24          				apiVersion: "core.oam.dev/v1beta1"
    25          				kind:       "Application"
    26          				metadata: {
    27          					name: parameter.name
    28          					if parameter.namespace != _|_ {
    29          						namespace: parameter.namespace
    30          					}
    31          				}
    32          			}
    33          			cluster: parameter.cluster
    34          		}
    35          	}
    36          	if parameter.apiVersion != _|_ || parameter.kind != _|_ {
    37          		op.#Read & {
    38          			value: {
    39          				apiVersion: parameter.apiVersion
    40          				kind:       parameter.kind
    41          				metadata: {
    42          					name: parameter.name
    43          					if parameter.namespace != _|_ {
    44          						namespace: parameter.namespace
    45          					}
    46          				}
    47          			}
    48          			cluster: parameter.cluster
    49          		}
    50          	}
    51          }
    52          parameter: {
    53          	// +usage=Specify the apiVersion of the object, defaults to 'core.oam.dev/v1beta1'
    54          	apiVersion?: string
    55          	// +usage=Specify the kind of the object, defaults to Application
    56          	kind?: string
    57          	// +usage=Specify the name of the object
    58          	name: string
    59          	// +usage=The namespace of the resource you want to read
    60          	namespace?: *"default" | string
    61          	// +usage=The cluster you want to apply the resource to, default is the current control plane cluster
    62          	cluster: *"" | string
    63          }
    64