mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
* feat: add new providers and fix definitions Signed-off-by: FogDong <fog@bentoml.com> * fix: fix definitions and tests Signed-off-by: FogDong <fog@bentoml.com> * fix: fix lint and helm Signed-off-by: FogDong <fog@bentoml.com> * fix: fix definitions Signed-off-by: FogDong <fog@bentoml.com> * fix: add multicluster Signed-off-by: FogDong <fog@bentoml.com> * fix: fix e2e Signed-off-by: FogDong <fog@bentoml.com> * fix: fix dynamic client for cli Signed-off-by: FogDong <fog@bentoml.com> * fix: fix api gen Signed-off-by: FogDong <fog@bentoml.com> * fix: fix lint Signed-off-by: FogDong <fog@bentoml.com> --------- Signed-off-by: FogDong <fog@bentoml.com>
58 lines
1.2 KiB
CUE
58 lines
1.2 KiB
CUE
import (
|
|
"strconv"
|
|
"strings"
|
|
"vela/kube"
|
|
"vela/builtin"
|
|
)
|
|
|
|
"apply-deployment": {
|
|
alias: ""
|
|
annotations: {}
|
|
attributes: {}
|
|
description: "Apply deployment with specified image and cmd."
|
|
annotations: {
|
|
"category": "Resource Management"
|
|
}
|
|
labels: {}
|
|
type: "workflow-step"
|
|
}
|
|
|
|
template: {
|
|
output: kube.#Apply & {
|
|
$params: {
|
|
cluster: parameter.cluster
|
|
value: {
|
|
apiVersion: "apps/v1"
|
|
kind: "Deployment"
|
|
metadata: {
|
|
name: context.stepName
|
|
namespace: context.namespace
|
|
}
|
|
spec: {
|
|
selector: matchLabels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
|
|
replicas: parameter.replicas
|
|
template: {
|
|
metadata: labels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
|
|
spec: containers: [{
|
|
name: context.stepName
|
|
image: parameter.image
|
|
if parameter["cmd"] != _|_ {
|
|
command: parameter.cmd
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
wait: builtin.#ConditionalWait & {
|
|
$params: continue: output.$returns.value.status.readyReplicas == parameter.replicas
|
|
}
|
|
parameter: {
|
|
image: string
|
|
replicas: *1 | int
|
|
cluster: *"" | string
|
|
cmd?: [...string]
|
|
}
|
|
}
|