diff --git a/charts/vela-core/templates/defwithtemplate/print-message-in-status.yaml b/charts/vela-core/templates/defwithtemplate/print-message-in-status.yaml new file mode 100644 index 000000000..4ad146465 --- /dev/null +++ b/charts/vela-core/templates/defwithtemplate/print-message-in-status.yaml @@ -0,0 +1,24 @@ +# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file. +# Definition source cue file: vela-templates/definitions/internal/print-message-in-status.cue +apiVersion: core.oam.dev/v1beta1 +kind: WorkflowStepDefinition +metadata: + annotations: + definition.oam.dev/description: pring message in workflow status + labels: + custom.definition.oam.dev/ui-hidden: "true" + name: print-message-in-status + namespace: {{ include "systemDefinitionNamespace" . }} +spec: + schematic: + cue: + template: | + import ( + "vela/op" + ) + + parameter: message: string + msg: op.#Message & { + message: parameter.message + } + diff --git a/charts/vela-minimal/templates/defwithtemplate/print-message-in-status.yaml b/charts/vela-minimal/templates/defwithtemplate/print-message-in-status.yaml new file mode 100644 index 000000000..4ad146465 --- /dev/null +++ b/charts/vela-minimal/templates/defwithtemplate/print-message-in-status.yaml @@ -0,0 +1,24 @@ +# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file. +# Definition source cue file: vela-templates/definitions/internal/print-message-in-status.cue +apiVersion: core.oam.dev/v1beta1 +kind: WorkflowStepDefinition +metadata: + annotations: + definition.oam.dev/description: pring message in workflow status + labels: + custom.definition.oam.dev/ui-hidden: "true" + name: print-message-in-status + namespace: {{ include "systemDefinitionNamespace" . }} +spec: + schematic: + cue: + template: | + import ( + "vela/op" + ) + + parameter: message: string + msg: op.#Message & { + message: parameter.message + } + diff --git a/go.mod b/go.mod index fd06c6972..c8f194088 100644 --- a/go.mod +++ b/go.mod @@ -55,9 +55,9 @@ require ( github.com/imdario/mergo v0.3.12 github.com/klauspost/compress v1.15.9 github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c - github.com/kubevela/pkg v0.0.0-20220930055431-990bad3c95e6 + github.com/kubevela/pkg v0.0.0-20221017134311-26e5042d4503 github.com/kubevela/prism v1.5.1-0.20220915071949-6bf3ad33f84f - github.com/kubevela/workflow v0.0.0-20221017133918-6fa45a4dc4cb + github.com/kubevela/workflow v0.0.0-20221019093241-b5b7a0d79051 github.com/kyokomi/emoji v2.2.4+incompatible github.com/mitchellh/hashstructure/v2 v2.0.1 github.com/oam-dev/cluster-gateway v1.4.0 @@ -88,7 +88,7 @@ require ( golang.org/x/crypto v0.0.0-20220507011949-2cf3adece122 golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 - golang.org/x/text v0.3.7 + golang.org/x/text v0.3.8 gomodules.xyz/jsonpatch/v2 v2.2.0 gopkg.in/src-d/go-git.v4 v4.13.1 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 6d1e76da1..178012553 100644 --- a/go.sum +++ b/go.sum @@ -1330,12 +1330,12 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubevela/pkg v0.0.0-20220930055431-990bad3c95e6 h1:O6eSMQvPmWMTdUSqKIU3eO3A8141ZwJTs5mkWKX/MLc= -github.com/kubevela/pkg v0.0.0-20220930055431-990bad3c95e6/go.mod h1:M1teY5NgwzOqvUdwSYKe1eM4Qe4EQj8Cr2oey2xhV3I= +github.com/kubevela/pkg v0.0.0-20221017134311-26e5042d4503 h1:dxCeaUM2nklZkhxBukYlmfzAbobdRaw8Y/Horqd7b0w= +github.com/kubevela/pkg v0.0.0-20221017134311-26e5042d4503/go.mod h1:M1teY5NgwzOqvUdwSYKe1eM4Qe4EQj8Cr2oey2xhV3I= github.com/kubevela/prism v1.5.1-0.20220915071949-6bf3ad33f84f h1:1lUtU1alPThdcsn4MI6XjPb7eJLuZPpmlEdgjtnUMKw= github.com/kubevela/prism v1.5.1-0.20220915071949-6bf3ad33f84f/go.mod h1:m724/7ANnB/iukyHW20+DicpeJMEC/JA0ZhgsHY10MA= -github.com/kubevela/workflow v0.0.0-20221017133918-6fa45a4dc4cb h1:rvbHSx2LDTT+4rWs1xrIIo0mmdAVvjb7yvLXwyjWGSQ= -github.com/kubevela/workflow v0.0.0-20221017133918-6fa45a4dc4cb/go.mod h1:bJzumt/0ZqiATc1fmVUE7pbU7RpS0r2ZfSQoD+6FmNU= +github.com/kubevela/workflow v0.0.0-20221019093241-b5b7a0d79051 h1:ET01t1GCjbERb+uwgGZnLHoLo4ceE1+gHnmgM/9or5g= +github.com/kubevela/workflow v0.0.0-20221019093241-b5b7a0d79051/go.mod h1:1XyGmfIkD6gPAegUkeDBXXModeiu8NVUWIgersTqwr8= github.com/kulti/thelper v0.4.0/go.mod h1:vMu2Cizjy/grP+jmsvOFDx1kYP6+PD1lqg4Yu5exl2U= github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4= github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= @@ -2537,8 +2537,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/pkg/stdlib/op.cue b/pkg/stdlib/op.cue index 08339f754..1bbd78a75 100644 --- a/pkg/stdlib/op.cue +++ b/pkg/stdlib/op.cue @@ -20,6 +20,11 @@ import ( message?: string } +#Message: { + #do: "message" + message?: string +} + #Apply: kube.#Apply #ApplyInParallel: kube.#ApplyInParallel diff --git a/pkg/stdlib/pkgs/kube.cue b/pkg/stdlib/pkgs/kube.cue index 47a16d0d0..6e0d7ed48 100644 --- a/pkg/stdlib/pkgs/kube.cue +++ b/pkg/stdlib/pkgs/kube.cue @@ -50,5 +50,9 @@ namespace: *"default" | string } } + filter?: { + namespace?: string + matchingLabels?: {...} + } ... } diff --git a/vela-templates/definitions/internal/workflowstep/print-message-in-status.cue b/vela-templates/definitions/internal/workflowstep/print-message-in-status.cue new file mode 100644 index 000000000..7118a07a1 --- /dev/null +++ b/vela-templates/definitions/internal/workflowstep/print-message-in-status.cue @@ -0,0 +1,22 @@ +import ( + "vela/op" +) + +"print-message-in-status": { + type: "workflow-step" + annotations: {} + labels: { + "ui-hidden": "true" + } + description: "pring message in workflow status" +} + +template: { + parameter: { + message: string + } + + msg: op.#Message & { + message: parameter.message + } +}