Skip to content

Commit edf9ae3

Browse files
authored
fix: render template with map[string]any (#9935)
1 parent a5a87d9 commit edf9ae3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pkg/controller/component/vars.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func resolveValueReferenceNEscaping(templateVars, credentialVars map[string]core
239239
func evaluateObjectVarsExpression(definedVars []appsv1.EnvVar, credentialVars []corev1.EnvVar, vars *[]corev1.EnvVar) error {
240240
var (
241241
isValues = make(map[string]bool)
242-
values = make(map[string]string)
242+
values = make(map[string]any)
243243
)
244244
normalize := func(name string) string {
245245
return strings.ReplaceAll(name, "-", "_")

pkg/kbagent/service/action_utils.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"context"
2525
"fmt"
2626
"io"
27-
"maps"
2827
"net"
2928
"net/http"
3029
"os"
@@ -601,9 +600,11 @@ func renderTemplateData(action string, parameters map[string]string, data string
601600
return buf.String(), nil
602601
}
603602

604-
func mergeEnvWith(parameters map[string]string) map[string]string {
605-
result := make(map[string]string)
606-
maps.Copy(result, parameters)
603+
func mergeEnvWith(parameters map[string]string) map[string]any {
604+
result := make(map[string]any)
605+
for k, v := range parameters {
606+
result[k] = v
607+
}
607608
for _, e := range os.Environ() {
608609
kv := strings.Split(e, "=")
609610
if _, ok := result[kv[0]]; !ok {

0 commit comments

Comments
 (0)