Ver código fonte

cast query to string

Alexander Belanger 5 anos atrás
pai
commit
192c472165
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      internal/templater/utils/query.go

+ 4 - 4
internal/templater/utils/query.go

@@ -2,7 +2,7 @@ package utils
 
 import (
 	"fmt"
-	"reflect"
+	"strings"
 
 	"github.com/porter-dev/porter/internal/templater"
 	"k8s.io/client-go/util/jsonpath"
@@ -44,15 +44,15 @@ func QueryValues(
 			continue
 		}
 
-		queryRes := make([]reflect.Value, 0)
+		queryRes := make([]string, 0)
 
 		for ix := range fullResults {
 			for _, result := range fullResults[ix] {
-				queryRes = append(queryRes, reflect.ValueOf(result.Interface()))
+				queryRes = append(queryRes, fmt.Sprintf("%v", result.Interface()))
 			}
 		}
 
-		res[query.Key] = queryRes
+		res[query.Key] = strings.Join(queryRes, ",")
 	}
 
 	return res, nil