Refactor: change field exportKey to valueFrom (#2284)

This commit is contained in:
Tianxin Dong
2021-09-14 10:23:39 +08:00
committed by GitHub
parent ce70f9f57f
commit e73655a8b2
21 changed files with 67 additions and 67 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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
+1 -1
View File
@@ -42,7 +42,7 @@ spec:
type: apply-base
outputs:
- name: baseIP
exportKey: clusterIP
valueFrom: clusterIP
properties:
component: base-service
- name: apply-redis
+1 -1
View File
@@ -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"},
},
},
},
+1 -1
View File
@@ -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
}
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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",
}},
},
{