From bffcfc6702ee7a20854ab9e5fcd3348a066dd440 Mon Sep 17 00:00:00 2001 From: FogDong Date: Wed, 28 Sep 2022 20:40:29 +0800 Subject: [PATCH] Fix: fix output doc Signed-off-by: FogDong --- .../workflow/component-dependency-parameter.md | 10 +++++++--- docs/end-user/workflow/inputs-outputs.md | 10 +++++++--- .../workflow/component-dependency-parameter.md | 10 +++++++--- .../current/end-user/workflow/inputs-outputs.md | 10 +++++++--- .../workflow/component-dependency-parameter.md | 10 +++++++--- .../workflow/component-dependency-parameter.md | 10 +++++++--- .../version-v1.4/end-user/workflow/inputs-outputs.md | 10 +++++++--- .../workflow/component-dependency-parameter.md | 10 +++++++--- .../version-v1.5/end-user/workflow/inputs-outputs.md | 10 +++++++--- .../workflow/component-dependency-parameter.md | 10 +++++++--- .../workflow/component-dependency-parameter.md | 10 +++++++--- .../version-v1.4/end-user/workflow/inputs-outputs.md | 10 +++++++--- .../workflow/component-dependency-parameter.md | 10 +++++++--- .../version-v1.5/end-user/workflow/inputs-outputs.md | 10 +++++++--- 14 files changed, 98 insertions(+), 42 deletions(-) diff --git a/docs/end-user/workflow/component-dependency-parameter.md b/docs/end-user/workflow/component-dependency-parameter.md index f20e6d1b..57b5a787 100644 --- a/docs/end-user/workflow/component-dependency-parameter.md +++ b/docs/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ In KubeVela, we can use inputs and outputs in Components to pass data. Outputs is made of `name` and `valueFrom`. Input will use `name` to reference output. We can write `valueFrom` in the following ways: -1. Fill string value in the field, eg. `valueFrom: testString`. -2. Use expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. -3. Use `+` to combine above two ways, the computed value will be the result, eg. `valueFrom: output.metadata.name + "testString"`. +1. Use value expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. +2. Use CUE expressions, eg. use `+` to combine value and string: `valueFrom: output.metadata.name + "testString"` or you can import built-in packages in CUE like: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/docs/end-user/workflow/inputs-outputs.md b/docs/end-user/workflow/inputs-outputs.md index 15d413a3..683bd61f 100644 --- a/docs/end-user/workflow/inputs-outputs.md +++ b/docs/end-user/workflow/inputs-outputs.md @@ -10,9 +10,13 @@ Outputs consists of `name` and `valueFrom`. `name` declares the name of this out `valueFrom` can be written in the following ways: -1. Fill string value in the field, eg. `valueFrom: "testString"`. -2. Use CUE expression, eg. `valueFrom: output.value.status.workflow.message`. Note that `output.value.status.workflow.message` will use the value of the variable from the CUE template of the current step. If this field does not exist in the CUE template of the step, the resulting value will be empty. -3. Use `+` to combine above two ways, the computed value will be the result, eg. `valueFrom: output.value.status.workflow.message + "testString"`. +1. Use value expression, eg. `valueFrom: output.value.status.workflow.message`. Note that `output.value.status.workflow.message` will use the value of the variable from the CUE template of the current step. If this field does not exist in the CUE template of the step, the resulting value will be empty. +2. Use CUE expressions, eg. use `+` to combine value and string: `valueFrom: output.metadata.name + "testString"` or you can import built-in packages in CUE like: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ## Inputs diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/component-dependency-parameter.md b/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/component-dependency-parameter.md index 9bd86878..5aa4d292 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/component-dependency-parameter.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ mysql mysql-secret raw running healthy 2021-10-14 12:09:55 +0 outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名称,在 input 中将通过 `from` 引用 output。 `valueFrom` 有以下几种写法: -1. 直接通过字符串表示值,如:`valueFrom: testString`。 -2. 通过表达式来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 -3. 通过 `+` 来任意连接以上两种写法,最终值是计算后的字符串拼接结果,如:`valueFrom: output.metadata.name + "testString"`。 +1. 通过指定 value 来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 +2. 使用 CUE 表达式。如,用 `+` 来连接值和字符串: `valueFrom: output.metadata.name + "testString"`。你也可以引入 CUE 的内置包: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/inputs-outputs.md b/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/inputs-outputs.md index eb2bc590..ab2f5009 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/inputs-outputs.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/end-user/workflow/inputs-outputs.md @@ -9,9 +9,13 @@ title: 数据传递 outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名称,在 input 中将通过 `from` 引用 output。 `valueFrom` 有以下几种写法: -1. 直接通过字符串表示值,如:`valueFrom: "testString"`。 -2. 通过 CUE 表达式来指定值,如:`valueFrom: output.value.status.workflow.message`。注意,`output.value.status.workflow.message` 将使用变量引用的方式从当前步骤的 CUE 模板中取值,如果该步骤的 CUE 模板中没有该字段,那么得到的值为空。 -3. 通过 `+` 来任意连接以上两种写法,最终值是计算后的字符串拼接结果,如:`valueFrom: output.value.status.workflow.message + "testString"`。 +1. 通过指定 value 来指定值,如:`valueFrom: output.value.status.workflow.message`。注意,`output.value.status.workflow.message` 将使用变量引用的方式从当前步骤的 CUE 模板中取值,如果该步骤的 CUE 模板中没有该字段,那么得到的值为空。 +2. 使用 CUE 表达式。如,用 `+` 来连接值和字符串: `valueFrom: output.metadata.name + "testString"`。你也可以引入 CUE 的内置包: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ## Inputs diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.3/end-user/workflow/component-dependency-parameter.md b/i18n/zh/docusaurus-plugin-content-docs/version-v1.3/end-user/workflow/component-dependency-parameter.md index 098a007a..80fec73f 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-v1.3/end-user/workflow/component-dependency-parameter.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-v1.3/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ mysql mysql-secret raw running healthy 2021-10-14 12:09:55 +0 outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名称,在 input 中将通过 `name` 引用 output。 `valueFrom` 有以下几种写法: -1. 直接通过字符串表示值,如:`valueFrom: testString`。 -2. 通过表达式来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 -3. 通过 `+` 来任意连接以上两种写法,最终值是计算后的字符串拼接结果,如:`valueFrom: output.metadata.name + "testString"`。 +1. 通过指定 value 来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 +2. 使用 CUE 表达式。如,用 `+` 来连接值和字符串: `valueFrom: output.metadata.name + "testString"`。你也可以引入 CUE 的内置包: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/component-dependency-parameter.md b/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/component-dependency-parameter.md index 9bd86878..5aa4d292 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/component-dependency-parameter.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ mysql mysql-secret raw running healthy 2021-10-14 12:09:55 +0 outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名称,在 input 中将通过 `from` 引用 output。 `valueFrom` 有以下几种写法: -1. 直接通过字符串表示值,如:`valueFrom: testString`。 -2. 通过表达式来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 -3. 通过 `+` 来任意连接以上两种写法,最终值是计算后的字符串拼接结果,如:`valueFrom: output.metadata.name + "testString"`。 +1. 通过指定 value 来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 +2. 使用 CUE 表达式。如,用 `+` 来连接值和字符串: `valueFrom: output.metadata.name + "testString"`。你也可以引入 CUE 的内置包: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/inputs-outputs.md b/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/inputs-outputs.md index eb2bc590..ab2f5009 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/inputs-outputs.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-v1.4/end-user/workflow/inputs-outputs.md @@ -9,9 +9,13 @@ title: 数据传递 outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名称,在 input 中将通过 `from` 引用 output。 `valueFrom` 有以下几种写法: -1. 直接通过字符串表示值,如:`valueFrom: "testString"`。 -2. 通过 CUE 表达式来指定值,如:`valueFrom: output.value.status.workflow.message`。注意,`output.value.status.workflow.message` 将使用变量引用的方式从当前步骤的 CUE 模板中取值,如果该步骤的 CUE 模板中没有该字段,那么得到的值为空。 -3. 通过 `+` 来任意连接以上两种写法,最终值是计算后的字符串拼接结果,如:`valueFrom: output.value.status.workflow.message + "testString"`。 +1. 通过指定 value 来指定值,如:`valueFrom: output.value.status.workflow.message`。注意,`output.value.status.workflow.message` 将使用变量引用的方式从当前步骤的 CUE 模板中取值,如果该步骤的 CUE 模板中没有该字段,那么得到的值为空。 +2. 使用 CUE 表达式。如,用 `+` 来连接值和字符串: `valueFrom: output.metadata.name + "testString"`。你也可以引入 CUE 的内置包: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ## Inputs diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/component-dependency-parameter.md b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/component-dependency-parameter.md index 9bd86878..5aa4d292 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/component-dependency-parameter.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ mysql mysql-secret raw running healthy 2021-10-14 12:09:55 +0 outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名称,在 input 中将通过 `from` 引用 output。 `valueFrom` 有以下几种写法: -1. 直接通过字符串表示值,如:`valueFrom: testString`。 -2. 通过表达式来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 -3. 通过 `+` 来任意连接以上两种写法,最终值是计算后的字符串拼接结果,如:`valueFrom: output.metadata.name + "testString"`。 +1. 通过指定 value 来指定值,如:`valueFrom: output.metadata.name`。注意,`output` 为固定内置字段,指向组件中被部署在集群里的资源。 +2. 使用 CUE 表达式。如,用 `+` 来连接值和字符串: `valueFrom: output.metadata.name + "testString"`。你也可以引入 CUE 的内置包: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/inputs-outputs.md b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/inputs-outputs.md index eb2bc590..ab2f5009 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/inputs-outputs.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-v1.5/end-user/workflow/inputs-outputs.md @@ -9,9 +9,13 @@ title: 数据传递 outputs 由 `name` 和 `valueFrom` 组成。`name` 声明了这个 output 的名称,在 input 中将通过 `from` 引用 output。 `valueFrom` 有以下几种写法: -1. 直接通过字符串表示值,如:`valueFrom: "testString"`。 -2. 通过 CUE 表达式来指定值,如:`valueFrom: output.value.status.workflow.message`。注意,`output.value.status.workflow.message` 将使用变量引用的方式从当前步骤的 CUE 模板中取值,如果该步骤的 CUE 模板中没有该字段,那么得到的值为空。 -3. 通过 `+` 来任意连接以上两种写法,最终值是计算后的字符串拼接结果,如:`valueFrom: output.value.status.workflow.message + "testString"`。 +1. 通过指定 value 来指定值,如:`valueFrom: output.value.status.workflow.message`。注意,`output.value.status.workflow.message` 将使用变量引用的方式从当前步骤的 CUE 模板中取值,如果该步骤的 CUE 模板中没有该字段,那么得到的值为空。 +2. 使用 CUE 表达式。如,用 `+` 来连接值和字符串: `valueFrom: output.metadata.name + "testString"`。你也可以引入 CUE 的内置包: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ## Inputs diff --git a/versioned_docs/version-v1.3/end-user/workflow/component-dependency-parameter.md b/versioned_docs/version-v1.3/end-user/workflow/component-dependency-parameter.md index 2a91d960..905b911c 100644 --- a/versioned_docs/version-v1.3/end-user/workflow/component-dependency-parameter.md +++ b/versioned_docs/version-v1.3/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ In KubeVela, we can use inputs and outputs in Components to pass data. Outputs is made of `name` and `valueFrom`. Input will use `name` to reference output. We can write `valueFrom` in the following ways: -1. Fill string value in the field, eg. `valueFrom: testString`. -2. Use expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. -3. Use `+` to combine above two ways, the computed value will be the result, eg. `valueFrom: output.metadata.name + "testString"`. +1. Use value expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. +2. Use CUE expressions, eg. use `+` to combine value and string: `valueFrom: output.metadata.name + "testString"` or you can import built-in packages in CUE like: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/versioned_docs/version-v1.4/end-user/workflow/component-dependency-parameter.md b/versioned_docs/version-v1.4/end-user/workflow/component-dependency-parameter.md index 394ac9ae..ad8f0e9d 100644 --- a/versioned_docs/version-v1.4/end-user/workflow/component-dependency-parameter.md +++ b/versioned_docs/version-v1.4/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ In KubeVela, we can use inputs and outputs in Components to pass data. Outputs is made of `name` and `valueFrom`. Input will use `name` to reference output. We can write `valueFrom` in the following ways: -1. Fill string value in the field, eg. `valueFrom: testString`. -2. Use expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. -3. Use `+` to combine above two ways, the computed value will be the result, eg. `valueFrom: output.metadata.name + "testString"`. +1. Use value expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. +2. Use CUE expressions, eg. use `+` to combine value and string: `valueFrom: output.metadata.name + "testString"` or you can import built-in packages in CUE like: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/versioned_docs/version-v1.4/end-user/workflow/inputs-outputs.md b/versioned_docs/version-v1.4/end-user/workflow/inputs-outputs.md index 15d413a3..683bd61f 100644 --- a/versioned_docs/version-v1.4/end-user/workflow/inputs-outputs.md +++ b/versioned_docs/version-v1.4/end-user/workflow/inputs-outputs.md @@ -10,9 +10,13 @@ Outputs consists of `name` and `valueFrom`. `name` declares the name of this out `valueFrom` can be written in the following ways: -1. Fill string value in the field, eg. `valueFrom: "testString"`. -2. Use CUE expression, eg. `valueFrom: output.value.status.workflow.message`. Note that `output.value.status.workflow.message` will use the value of the variable from the CUE template of the current step. If this field does not exist in the CUE template of the step, the resulting value will be empty. -3. Use `+` to combine above two ways, the computed value will be the result, eg. `valueFrom: output.value.status.workflow.message + "testString"`. +1. Use value expression, eg. `valueFrom: output.value.status.workflow.message`. Note that `output.value.status.workflow.message` will use the value of the variable from the CUE template of the current step. If this field does not exist in the CUE template of the step, the resulting value will be empty. +2. Use CUE expressions, eg. use `+` to combine value and string: `valueFrom: output.metadata.name + "testString"` or you can import built-in packages in CUE like: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ## Inputs diff --git a/versioned_docs/version-v1.5/end-user/workflow/component-dependency-parameter.md b/versioned_docs/version-v1.5/end-user/workflow/component-dependency-parameter.md index f20e6d1b..57b5a787 100644 --- a/versioned_docs/version-v1.5/end-user/workflow/component-dependency-parameter.md +++ b/versioned_docs/version-v1.5/end-user/workflow/component-dependency-parameter.md @@ -115,9 +115,13 @@ In KubeVela, we can use inputs and outputs in Components to pass data. Outputs is made of `name` and `valueFrom`. Input will use `name` to reference output. We can write `valueFrom` in the following ways: -1. Fill string value in the field, eg. `valueFrom: testString`. -2. Use expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. -3. Use `+` to combine above two ways, the computed value will be the result, eg. `valueFrom: output.metadata.name + "testString"`. +1. Use value expression, eg. `valueFrom: output.metadata.name`. Note that `output` is a built-in field referring to the resource in the component that is rendered and deployed to the cluster. +2. Use CUE expressions, eg. use `+` to combine value and string: `valueFrom: output.metadata.name + "testString"` or you can import built-in packages in CUE like: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ### Inputs diff --git a/versioned_docs/version-v1.5/end-user/workflow/inputs-outputs.md b/versioned_docs/version-v1.5/end-user/workflow/inputs-outputs.md index 15d413a3..683bd61f 100644 --- a/versioned_docs/version-v1.5/end-user/workflow/inputs-outputs.md +++ b/versioned_docs/version-v1.5/end-user/workflow/inputs-outputs.md @@ -10,9 +10,13 @@ Outputs consists of `name` and `valueFrom`. `name` declares the name of this out `valueFrom` can be written in the following ways: -1. Fill string value in the field, eg. `valueFrom: "testString"`. -2. Use CUE expression, eg. `valueFrom: output.value.status.workflow.message`. Note that `output.value.status.workflow.message` will use the value of the variable from the CUE template of the current step. If this field does not exist in the CUE template of the step, the resulting value will be empty. -3. Use `+` to combine above two ways, the computed value will be the result, eg. `valueFrom: output.value.status.workflow.message + "testString"`. +1. Use value expression, eg. `valueFrom: output.value.status.workflow.message`. Note that `output.value.status.workflow.message` will use the value of the variable from the CUE template of the current step. If this field does not exist in the CUE template of the step, the resulting value will be empty. +2. Use CUE expressions, eg. use `+` to combine value and string: `valueFrom: output.metadata.name + "testString"` or you can import built-in packages in CUE like: +``` +valueFrom: | + import "strings" + strings.Join(["1","2"], ",") +``` ## Inputs