Fix: load in cue actions (#283)

This commit is contained in:
Tianxin Dong 2021-09-15 14:02:00 +08:00 committed by GitHub
parent 11cdbe6475
commit 2701b5e707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 30 deletions

View File

@ -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

View File

@ -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