mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
Refactor: change field exportKey to valueFrom (#2284)
This commit is contained in:
@@ -407,7 +407,7 @@ type inputItem struct {
|
||||
}
|
||||
|
||||
type outputItem struct {
|
||||
ExportKey string `json:"exportKey"`
|
||||
ValueFrom string `json:"valueFrom"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -240,7 +240,7 @@ spec:
|
||||
component: ack-worker
|
||||
outputs:
|
||||
- name: connInfo
|
||||
exportKey: connInfo
|
||||
valueFrom: connInfo
|
||||
|
||||
- name: register-ack
|
||||
type: register-cluster
|
||||
|
||||
@@ -21,7 +21,7 @@ spec:
|
||||
component: ack-worker
|
||||
outputs:
|
||||
- name: connInfo
|
||||
exportKey: connInfo
|
||||
valueFrom: connInfo
|
||||
|
||||
- name: register-ack
|
||||
type: register-cluster
|
||||
|
||||
@@ -42,7 +42,7 @@ spec:
|
||||
type: apply-base
|
||||
outputs:
|
||||
- name: baseIP
|
||||
exportKey: clusterIP
|
||||
valueFrom: clusterIP
|
||||
properties:
|
||||
component: base-service
|
||||
- name: apply-redis
|
||||
|
||||
@@ -21,7 +21,7 @@ spec:
|
||||
component: "server1"
|
||||
outputs:
|
||||
- name: server1IP
|
||||
exportKey: "myIP"
|
||||
valueFrom: "myIP"
|
||||
- name: deploy-server2
|
||||
type: apply-with-ip
|
||||
inputs:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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",
|
||||
}},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user