|
|
|
@ -21,6 +21,7 @@ import (
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"log/slog"
|
|
|
|
"maps"
|
|
|
|
"maps"
|
|
|
|
"math"
|
|
|
|
"math"
|
|
|
|
"reflect"
|
|
|
|
"reflect"
|
|
|
|
@ -88,8 +89,15 @@ func funcMap() template.FuncMap {
|
|
|
|
"tpl": func(string, any) any { return "not implemented" },
|
|
|
|
"tpl": func(string, any) any { return "not implemented" },
|
|
|
|
"required": func(string, any) (any, error) { return "not implemented", nil },
|
|
|
|
"required": func(string, any) (any, error) { return "not implemented", nil },
|
|
|
|
// Provide a placeholder for the "lookup" function, which requires a kubernetes
|
|
|
|
// Provide a placeholder for the "lookup" function, which requires a kubernetes
|
|
|
|
// connection.
|
|
|
|
// connection. Emits a debug log so `helm template --debug` surfaces the fact
|
|
|
|
"lookup": func(string, string, string, string) (map[string]any, error) {
|
|
|
|
// that a chart's `lookup` calls are being silently short-circuited.
|
|
|
|
|
|
|
|
"lookup": func(apiVersion, kind, namespace, name string) (map[string]any, error) {
|
|
|
|
|
|
|
|
slog.Debug("lookup: no Kubernetes client available, returning empty result",
|
|
|
|
|
|
|
|
slog.String("apiVersion", apiVersion),
|
|
|
|
|
|
|
|
slog.String("kind", kind),
|
|
|
|
|
|
|
|
slog.String("namespace", namespace),
|
|
|
|
|
|
|
|
slog.String("name", name),
|
|
|
|
|
|
|
|
)
|
|
|
|
return map[string]any{}, nil
|
|
|
|
return map[string]any{}, nil
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|