From 6cec8b3ee0eaa86a866f429ac6108283d669dd91 Mon Sep 17 00:00:00 2001 From: Eoin McAfee Date: Thu, 3 Jun 2021 14:17:39 +0100 Subject: [PATCH] tech qa refactor for looping through data inputs --- plugin/converter/jsonnet/jsonnet.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugin/converter/jsonnet/jsonnet.go b/plugin/converter/jsonnet/jsonnet.go index 57dc478c6..bdb4efa2a 100644 --- a/plugin/converter/jsonnet/jsonnet.go +++ b/plugin/converter/jsonnet/jsonnet.go @@ -2,6 +2,7 @@ package jsonnet import ( "bytes" + "fmt" "github.com/drone/drone/core" @@ -27,11 +28,9 @@ func Parse(req *core.ConvertArgs, template *core.Template, templateData map[stri // map external inputs if len(templateData) != 0 { for k, v := range templateData { - if s, ok := v.(string); ok { - key := "input." + k - vm.ExtVar(key, s) - } - + key := fmt.Sprintf("input." + k) + val := fmt.Sprint(v) + vm.ExtVar(key, val) } } // convert the jsonnet file to yaml