From 2701b5e7076698d235d9b32c1041193fa79973c4 Mon Sep 17 00:00:00 2001 From: Tianxin Dong Date: Wed, 15 Sep 2021 14:02:00 +0800 Subject: [PATCH] Fix: load in cue actions (#283) --- .../workflow/cue-actions.md | 20 +++++-------------- .../workflow/cue-actions.md | 20 +++++-------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/docs/platform-engineers/workflow/cue-actions.md b/docs/platform-engineers/workflow/cue-actions.md index f45b8550..ff645e5c 100644 --- a/docs/platform-engineers/workflow/cue-actions.md +++ b/docs/platform-engineers/workflow/cue-actions.md @@ -82,22 +82,14 @@ wait: op.#ConditionalWait: { --- -Get component from application by component name. +Get all components in application. ### Action Parameter -- component: the component name. -- workload: the workload resource of the component. -- auxiliaries: the auxiliary resources of the component. +No parameters. ``` -#Load: { - component: string - value: { - workload: {...} - auxiliaries: [string]: {...} - } -} +#Load: {} ``` ### Usage @@ -105,10 +97,8 @@ Get component from application by component name. ``` import "vela/op" -// You can use load.workload & load.traits after this action. -load: op.#Load & { - component: "component-name" -} +// You can use `load.value.[componentName] after this action. +load: op.#Load & {} ``` ## Read diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/platform-engineers/workflow/cue-actions.md b/i18n/zh/docusaurus-plugin-content-docs/current/platform-engineers/workflow/cue-actions.md index 5bf870b7..3b7205a1 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/platform-engineers/workflow/cue-actions.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/platform-engineers/workflow/cue-actions.md @@ -82,23 +82,15 @@ wait: op.#ConditionalWait & { --- -通过组件名称从 Application 中获取组件对应的资源数据。 +获取 Application 中所有组件对应的资源数据。 ### 操作参数 -- component: 指定资源名称。 -- workload: 获取到的组件的 workload 资源定义。 -- auxiliaries: 获取到的组件的辅助资源定义(key 为定义里面 outputs 对应的资源名)。 +无需指定参数。 ``` -#Load: { - component: string - value: { - workload: {...} - auxiliaries: [string]: {...} - } -} +#Load: {} ``` ### 用法示例 @@ -106,10 +98,8 @@ wait: op.#ConditionalWait & { ``` import "vela/op" -// 该操作完成后,你可以使用 `load.value.workload` 以及 `load.value.traits` 来获取到组件相应的资源数据 -load: op.#Load & { - component: "component-name" -} +// 该操作完成后,你可以使用 `load.value.[componentName]` 来获取到对应组件的资源数据 +load: op.#Load & {} ``` ## Read