mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 12:06:38 +00:00
(cherry picked from commit 5369aa666a)
Signed-off-by: vishal210893 <vishal210893@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
This commit is contained in:
co-authored by
Vishal Kumar
parent
c634ea86c0
commit
ccd9e50f38
@@ -146,7 +146,7 @@ func getStatusMap(templateContext map[string]interface{}, statusFields string, p
|
||||
contextLabels = append(contextLabels, iter.Label())
|
||||
}
|
||||
|
||||
cueBuffer := runtimeContextBuff + "\n" + statusFields
|
||||
cueBuffer := statusFields + "\n" + runtimeContextBuff
|
||||
val := cueCtx.CompileString(cueBuffer)
|
||||
if val.Err() != nil {
|
||||
return templateContext, nil, errors.WithMessage(val.Err(), "compile status fields template")
|
||||
|
||||
@@ -329,6 +329,19 @@ func TestGetStatus(t *testing.T) {
|
||||
"sum": "4",
|
||||
},
|
||||
},
|
||||
"test-status-with-import-statement": {
|
||||
tpContext: map[string]interface{}{
|
||||
"output": map[string]interface{}{},
|
||||
},
|
||||
parameter: make(map[string]interface{}),
|
||||
statusCue: strings.TrimSpace(`
|
||||
import "strings"
|
||||
"my.details": strings.Join(["foo", "bar"], ",")
|
||||
`),
|
||||
expStatus: map[string]string{
|
||||
"my.details": "foo,bar",
|
||||
},
|
||||
},
|
||||
"test-key-input-too-large-skipped": {
|
||||
tpContext: map[string]interface{}{
|
||||
"output": map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user