Revert "cleanup: remove all about v0.x" (#1918)

Revert "cleanup: remove all about v0.x (#1903)"

This reverts commit d7bcd5e998.

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2025-02-08 18:25:16 +08:00
committed by GitHub
parent 6cb42d1416
commit 63e2684ade
229 changed files with 9464 additions and 510 deletions
+15 -1
View File
@@ -19,6 +19,7 @@ import (
"github.com/helmfile/helmfile/pkg/envvar"
"github.com/helmfile/helmfile/pkg/helmexec"
"github.com/helmfile/helmfile/pkg/maputil"
"github.com/helmfile/helmfile/pkg/runtime"
"github.com/helmfile/helmfile/pkg/yaml"
)
@@ -36,10 +37,23 @@ func (e DisableInsecureFeaturesError) Error() string {
var (
disableInsecureFeatures bool
// TODO: Remove this function once Helmfile v0.x
skipInsecureTemplateFunctions bool
)
func init() {
disableInsecureFeatures, _ = strconv.ParseBool(os.Getenv(envvar.DisableInsecureFeatures))
// TODO: Remove this function once Helmfile v0.x
skipInsecureTemplateFunctions, _ = strconv.ParseBool(os.Getenv(envvar.SkipInsecureTemplateFunctions))
skipInsecureTemplateFunctions = func() bool {
if runtime.V1Mode {
return false
}
b, _ := strconv.ParseBool(os.Getenv(envvar.SkipInsecureTemplateFunctions))
return b
}()
}
func (c *Context) createFuncMap() template.FuncMap {
@@ -62,7 +76,7 @@ func (c *Context) createFuncMap() template.FuncMap {
"fetchSecretValue": fetchSecretValue,
"expandSecretRefs": fetchSecretValues,
}
if c.preRender {
if c.preRender || skipInsecureTemplateFunctions {
// disable potential side-effect template calls
funcMap["exec"] = func(string, []any, ...string) (string, error) {
return "", nil