diff --git a/apis/core.oam.dev/common/types.go b/apis/core.oam.dev/common/types.go index 69c2c8fa5..8fcde0d6b 100644 --- a/apis/core.oam.dev/common/types.go +++ b/apis/core.oam.dev/common/types.go @@ -407,7 +407,7 @@ type inputItem struct { } type outputItem struct { - ExportKey string `json:"exportKey"` + ValueFrom string `json:"valueFrom"` Name string `json:"name"` } diff --git a/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml b/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml index da6386844..bcf84397e 100644 --- a/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml +++ b/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml @@ -2080,13 +2080,13 @@ spec: WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -2500,13 +2500,13 @@ spec: of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/charts/vela-core/crds/core.oam.dev_applications.yaml b/charts/vela-core/crds/core.oam.dev_applications.yaml index e615171eb..012919670 100644 --- a/charts/vela-core/crds/core.oam.dev_applications.yaml +++ b/charts/vela-core/crds/core.oam.dev_applications.yaml @@ -784,13 +784,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -1096,13 +1096,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/charts/vela-core/crds/core.oam.dev_envbindings.yaml b/charts/vela-core/crds/core.oam.dev_envbindings.yaml index 63a4849aa..a271d2ed4 100644 --- a/charts/vela-core/crds/core.oam.dev_envbindings.yaml +++ b/charts/vela-core/crds/core.oam.dev_envbindings.yaml @@ -98,13 +98,13 @@ spec: WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/charts/vela-core/crds/core.oam.dev_initializers.yaml b/charts/vela-core/crds/core.oam.dev_initializers.yaml index 6c5b03b85..47f07d076 100644 --- a/charts/vela-core/crds/core.oam.dev_initializers.yaml +++ b/charts/vela-core/crds/core.oam.dev_initializers.yaml @@ -113,13 +113,13 @@ spec: WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -533,13 +533,13 @@ spec: of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/charts/vela-core/crds/core.oam.dev_workflows.yaml b/charts/vela-core/crds/core.oam.dev_workflows.yaml index 8b8163f53..2f3b2b9bc 100644 --- a/charts/vela-core/crds/core.oam.dev_workflows.yaml +++ b/charts/vela-core/crds/core.oam.dev_workflows.yaml @@ -70,13 +70,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -318,13 +318,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/design/vela-core/environment.md b/design/vela-core/environment.md index d2b6ccb55..9f4d85ace 100644 --- a/design/vela-core/environment.md +++ b/design/vela-core/environment.md @@ -240,7 +240,7 @@ spec: component: ack-worker outputs: - name: connInfo - exportKey: connInfo + valueFrom: connInfo - name: register-ack type: register-cluster diff --git a/docs/examples/workflow-with-ocm/initializers/init-managed-cluster.yaml b/docs/examples/workflow-with-ocm/initializers/init-managed-cluster.yaml index df44bdd31..32a26f0a2 100644 --- a/docs/examples/workflow-with-ocm/initializers/init-managed-cluster.yaml +++ b/docs/examples/workflow-with-ocm/initializers/init-managed-cluster.yaml @@ -21,7 +21,7 @@ spec: component: ack-worker outputs: - name: connInfo - exportKey: connInfo + valueFrom: connInfo - name: register-ack type: register-cluster diff --git a/docs/examples/workflow/Li-Auto-Inc/app.yaml b/docs/examples/workflow/Li-Auto-Inc/app.yaml index 3bc37ff42..5bc1f13b0 100644 --- a/docs/examples/workflow/Li-Auto-Inc/app.yaml +++ b/docs/examples/workflow/Li-Auto-Inc/app.yaml @@ -42,7 +42,7 @@ spec: type: apply-base outputs: - name: baseIP - exportKey: clusterIP + valueFrom: clusterIP properties: component: base-service - name: apply-redis diff --git a/docs/examples/workflow/basic-app.yaml b/docs/examples/workflow/basic-app.yaml index 98b7d8289..60d61f74a 100644 --- a/docs/examples/workflow/basic-app.yaml +++ b/docs/examples/workflow/basic-app.yaml @@ -21,7 +21,7 @@ spec: component: "server1" outputs: - name: server1IP - exportKey: "myIP" + valueFrom: "myIP" - name: deploy-server2 type: apply-with-ip inputs: diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml index 417b06910..035e05ece 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml @@ -2080,13 +2080,13 @@ spec: WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -2500,13 +2500,13 @@ spec: of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml index f113953a0..706b0d8f9 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml @@ -1034,13 +1034,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -1428,13 +1428,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_envbindings.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_envbindings.yaml index 8db9acac9..cabc7870a 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_envbindings.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_envbindings.yaml @@ -98,13 +98,13 @@ spec: WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml index c3ba58ddb..1da7d95b2 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml @@ -113,13 +113,13 @@ spec: WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -533,13 +533,13 @@ spec: of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflows.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflows.yaml index c5006e461..bb28629c7 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflows.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflows.yaml @@ -70,13 +70,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: @@ -318,13 +318,13 @@ spec: description: StepOutputs defines output variable of WorkflowStep items: properties: - exportKey: - type: string name: type: string + valueFrom: + type: string required: - - exportKey - name + - valueFrom type: object type: array properties: diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go b/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go index f136cdd25..a96e1c01e 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go @@ -1759,7 +1759,7 @@ var _ = Describe("Test Application Controller", func() { Type: "worker-with-health", Properties: runtime.RawExtension{Raw: []byte(`{"cmd":["sleep","1000"],"image":"busybox","lives": "i am lives","enemies": "empty"}`)}, Outputs: common.StepOutputs{ - {Name: "message", ExportKey: "output.status.conditions[0].message+\",\"+outputs.gameconfig.data.lives"}, + {Name: "message", ValueFrom: "output.status.conditions[0].message+\",\"+outputs.gameconfig.data.lives"}, }, }, }, diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/generator_test.go b/pkg/controller/core.oam.dev/v1alpha2/application/generator_test.go index a45017799..7df36d55e 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/generator_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/generator_test.go @@ -100,7 +100,7 @@ var _ = Describe("Test Application workflow generator", func() { Outputs: common.StepOutputs{ { Name: "message", - ExportKey: "output.status.conditions[0].message+\",\"+outputs.gameconfig.data.lives", + ValueFrom: "output.status.conditions[0].message+\",\"+outputs.gameconfig.data.lives", }, }, }, diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/workflow_test.go b/pkg/controller/core.oam.dev/v1alpha2/application/workflow_test.go index 2705728bd..764d96436 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/workflow_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/workflow_test.go @@ -369,7 +369,7 @@ var _ = Describe("Test Workflow", func() { Type: "worker-with-health", Properties: runtime.RawExtension{Raw: []byte(`{"cmd":["sleep","1000"],"image":"busybox","lives": "i am lives","enemies": "empty"}`)}, Outputs: common.StepOutputs{ - {Name: "message", ExportKey: "output.status.conditions[0].message+\",\"+outputs.gameconfig.data.lives"}, + {Name: "message", ValueFrom: "output.status.conditions[0].message+\",\"+outputs.gameconfig.data.lives"}, }, }, }, diff --git a/pkg/workflow/hooks/data_passing.go b/pkg/workflow/hooks/data_passing.go index 24cff2e1a..cd4a49383 100644 --- a/pkg/workflow/hooks/data_passing.go +++ b/pkg/workflow/hooks/data_passing.go @@ -45,7 +45,7 @@ func Input(ctx wfContext.Context, paramValue *value.Value, step v1beta1.Workflow func Output(ctx wfContext.Context, taskValue *value.Value, step v1beta1.WorkflowStep, phase common.WorkflowStepPhase) error { if phase == common.WorkflowStepPhaseSucceeded { for _, output := range step.Outputs { - v, err := taskValue.LookupByScript(output.ExportKey) + v, err := taskValue.LookupByScript(output.ValueFrom) if err != nil { return err } diff --git a/pkg/workflow/hooks/data_passing_test.go b/pkg/workflow/hooks/data_passing_test.go index f4bedbb09..aefd5fc13 100644 --- a/pkg/workflow/hooks/data_passing_test.go +++ b/pkg/workflow/hooks/data_passing_test.go @@ -61,7 +61,7 @@ output: score: 99 assert.NilError(t, err) Output(wfCtx, taskValue, v1beta1.WorkflowStep{ Outputs: common.StepOutputs{{ - ExportKey: "output.score", + ValueFrom: "output.score", Name: "myscore", }}, }, common.WorkflowStepPhaseSucceeded) diff --git a/pkg/workflow/tasks/custom/task_test.go b/pkg/workflow/tasks/custom/task_test.go index 97ff5b461..f7d01c4fd 100644 --- a/pkg/workflow/tasks/custom/task_test.go +++ b/pkg/workflow/tasks/custom/task_test.go @@ -78,7 +78,7 @@ myIP: value: "1.1.1.1" Name: "output", Type: "output", Outputs: common.StepOutputs{{ - ExportKey: "myIP.value", + ValueFrom: "myIP.value", Name: "podIP", }}, }, @@ -200,7 +200,7 @@ close({ Type: "ok", Outputs: common.StepOutputs{{ Name: "podIP", - ExportKey: "myIP", + ValueFrom: "myIP", }}, }, { @@ -208,7 +208,7 @@ close({ Type: "ok", Outputs: common.StepOutputs{{ Name: "score", - ExportKey: "name", + ValueFrom: "name", }}, }, {