mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-19 04:26:39 +00:00
Feat(workflow): input.ParameterKey described like paths notation (#2214)
* Feat(workflow): input.ParameterKey path notation * Feat(workflow): add test case * Fix(lint): format code
This commit is contained in:
@@ -109,7 +109,7 @@ func (t *TaskLoader) makeTaskGenerator(templ string) (wfTypes.TaskGenerator, err
|
||||
if err != nil {
|
||||
return common.WorkflowStepStatus{}, nil, errors.WithMessagef(err, "get input from [%s]", input.From)
|
||||
}
|
||||
if err := paramsValue.FillObject(inputValue, input.ParameterKey); err != nil {
|
||||
if err := paramsValue.FillObject(inputValue, strings.Split(input.ParameterKey, ".")...); err != nil {
|
||||
return common.WorkflowStepStatus{}, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ myIP: value: "1.1.1.1"
|
||||
return v.FillObject(ip)
|
||||
},
|
||||
"input": func(ctx wfContext.Context, v *value.Value, act types.Action) error {
|
||||
val, err := v.LookupValue("prefixIP")
|
||||
val, err := v.LookupValue("set", "prefixIP")
|
||||
assert.NilError(t, err)
|
||||
str, err := val.CueValue().String()
|
||||
assert.NilError(t, err)
|
||||
@@ -87,7 +87,7 @@ myIP: value: "1.1.1.1"
|
||||
Type: "input",
|
||||
Inputs: v1beta1.StepInputs{{
|
||||
From: "podIP",
|
||||
ParameterKey: "prefixIP",
|
||||
ParameterKey: "set.prefixIP",
|
||||
}},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user