mirror of
https://github.com/kubevela/kubevela.git
synced 2026-03-05 19:22:03 +00:00
* Feat: ref component Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: support topology and override Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: add support for external policy and workflow Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: add admission control Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: disable cross namespace ref object Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Chore: refactor Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: support labelSelector in ref-objects Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: add pre approve for deploy step Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Chore: refactor Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: test Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: support comp/trait type in override policy even not used by prototype Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: support regex match for patch component name Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: labelSelector not work for cluster Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: ref workflow contains external policy Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: revision test Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: parallel apply components Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: add test for oam provider Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: service ref-comp & indirect trait ns Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: align namespace setting for chart Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: add strict unmarshal and reformat Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: merge with cluster rework Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: patch trait-def Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: apply components + load dynamic component Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: add test for loadPoliciesInOrder Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Feat: add test for open merge Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: reformat & add test for step generator Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: add test for parse override policy related defs Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: add test for multicluster provider (expandTopology and overrideConfiguration) Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: add admission test Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: revert trait status pass in component status Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: add test for dependency in workflowstep & standalone multicluster test Signed-off-by: Somefive <yd219913@alibaba-inc.com> * Fix: add check for ref and steps in WorkflowStep & enhance ref-objects scheme check Signed-off-by: Somefive <yd219913@alibaba-inc.com>
191 lines
3.5 KiB
CUE
191 lines
3.5 KiB
CUE
import (
|
|
"encoding/json"
|
|
"encoding/base64"
|
|
"strings"
|
|
)
|
|
|
|
#ConditionalWait: {
|
|
#do: "wait"
|
|
continue: bool
|
|
message?: string
|
|
}
|
|
|
|
#Break: {
|
|
#do: "break"
|
|
message?: string
|
|
}
|
|
|
|
#Apply: kube.#Apply
|
|
|
|
#ApplyInParallel: kube.#ApplyInParallel
|
|
|
|
#Read: kube.#Read
|
|
|
|
#List: kube.#List
|
|
|
|
#Delete: kube.#Delete
|
|
|
|
#ApplyApplication: #Steps & {
|
|
load: oam.#LoadComponetsInOrder @step(1)
|
|
components: #Steps & {
|
|
for name, c in load.value {
|
|
"\(name)": oam.#ApplyComponent & {
|
|
value: c
|
|
}
|
|
}
|
|
} @step(2)
|
|
}
|
|
|
|
// This operator will dispatch all the components in parallel when applying an application.
|
|
// Currently it works for Addon Observability to speed up the installation. It can also works for other applications, which
|
|
// needs to skip health check for components.
|
|
#ApplyApplicationInParallel: #Steps & {
|
|
load: oam.#LoadComponetsInOrder @step(1)
|
|
components: #Steps & {
|
|
for name, c in load.value {
|
|
"\(name)": oam.#ApplyComponent & {
|
|
value: c
|
|
waitHealthy: false
|
|
}
|
|
}
|
|
} @step(2)
|
|
}
|
|
|
|
#ApplyComponent: oam.#ApplyComponent
|
|
|
|
#ApplyComponents: oam.#ApplyComponents
|
|
|
|
#RenderComponent: oam.#RenderComponent
|
|
|
|
#ApplyComponentRemaining: #Steps & {
|
|
// exceptions specify the resources not to apply.
|
|
exceptions: [...string]
|
|
_exceptions: {for c in exceptions {"\(c)": true}}
|
|
component: string
|
|
|
|
load: oam.#LoadComponets @step(1)
|
|
render: #Steps & {
|
|
rendered: oam.#RenderComponent & {
|
|
value: load.value[component]
|
|
}
|
|
comp: kube.#Apply & {
|
|
value: rendered.output
|
|
}
|
|
for name, c in rendered.outputs {
|
|
if _exceptions[name] == _|_ {
|
|
"\(name)": kube.#Apply & {
|
|
value: c
|
|
}
|
|
}
|
|
}
|
|
} @step(2)
|
|
}
|
|
|
|
#ApplyRemaining: #Steps & {
|
|
// exceptions specify the resources not to apply.
|
|
exceptions: [...string]
|
|
_exceptions: {for c in exceptions {"\(c)": true}}
|
|
|
|
load: oam.#LoadComponets @step(1)
|
|
components: #Steps & {
|
|
for name, c in load.value {
|
|
if _exceptions[name] == _|_ {
|
|
"\(name)": oam.#ApplyComponent & {
|
|
value: c
|
|
}
|
|
}
|
|
|
|
}
|
|
} @step(2)
|
|
}
|
|
|
|
#DingTalk: #Steps & {
|
|
message: dingDing.#DingMessage
|
|
dingUrl: string
|
|
do: http.#Do & {
|
|
method: "POST"
|
|
url: dingUrl
|
|
request: {
|
|
body: json.Marshal(message)
|
|
header: "Content-Type": "application/json"
|
|
}
|
|
}
|
|
}
|
|
|
|
#Lark: #Steps & {
|
|
message: lark.#LarkMessage
|
|
larkUrl: string
|
|
do: http.#Do & {
|
|
method: "POST"
|
|
url: larkUrl
|
|
request: {
|
|
body: json.Marshal(message)
|
|
header: "Content-Type": "application/json"
|
|
}
|
|
}
|
|
}
|
|
|
|
#Slack: #Steps & {
|
|
message: slack.#SlackMessage
|
|
slackUrl: string
|
|
do: http.#Do & {
|
|
method: "POST"
|
|
url: slackUrl
|
|
request: {
|
|
body: json.Marshal(message)
|
|
header: "Content-Type": "application/json"
|
|
}
|
|
}
|
|
}
|
|
|
|
#ApplyEnvBindApp: multicluster.#ApplyEnvBindApp
|
|
|
|
#HandleDeployPolicies: multicluster.#HandleDeployPolicies
|
|
|
|
#DeployCloudResource: terraform.#DeployCloudResource
|
|
|
|
#ShareCloudResource: terraform.#ShareCloudResource
|
|
|
|
#LoadPolicies: oam.#LoadPolicies
|
|
|
|
#LoadPoliciesInOrder: oam.#LoadPoliciesInOrder
|
|
|
|
#ListClusters: multicluster.#ListClusters
|
|
|
|
#MakePlacementDecisions: multicluster.#MakePlacementDecisions
|
|
|
|
#PatchApplication: multicluster.#PatchApplication
|
|
|
|
#HTTPGet: http.#Do & {method: "GET"}
|
|
|
|
#HTTPPost: http.#Do & {method: "POST"}
|
|
|
|
#HTTPPut: http.#Do & {method: "PUT"}
|
|
|
|
#HTTPDelete: http.#Do & {method: "DELETE"}
|
|
|
|
#ConvertString: util.#String
|
|
|
|
#DateToTimestamp: time.#DateToTimestamp
|
|
|
|
#TimestampToDate: time.#TimestampToDate
|
|
|
|
#SendEmail: email.#Send
|
|
|
|
#Load: oam.#LoadComponets
|
|
|
|
#LoadInOrder: oam.#LoadComponetsInOrder
|
|
|
|
#PatchK8sObject: util.#PatchK8sObject
|
|
|
|
#Steps: {
|
|
#do: "steps"
|
|
...
|
|
}
|
|
|
|
#Task: task.#Task
|
|
|
|
NoExist: _|_
|
|
|
|
context: _
|