Bump helm.sh/helm/v3 from 3.10.3 to 3.11.1 (#5528)
This commit is contained in:
17
vendor/helm.sh/helm/v3/pkg/engine/engine.go
vendored
17
vendor/helm.sh/helm/v3/pkg/engine/engine.go
vendored
@@ -42,6 +42,15 @@ type Engine struct {
|
||||
LintMode bool
|
||||
// the rest config to connect to the kubernetes api
|
||||
config *rest.Config
|
||||
// EnableDNS tells the engine to allow DNS lookups when rendering templates
|
||||
EnableDNS bool
|
||||
}
|
||||
|
||||
// New creates a new instance of Engine using the passed in rest config.
|
||||
func New(config *rest.Config) Engine {
|
||||
return Engine{
|
||||
config: config,
|
||||
}
|
||||
}
|
||||
|
||||
// Render takes a chart, optional values, and value overrides, and attempts to render the Go templates.
|
||||
@@ -189,6 +198,14 @@ func (e Engine) initFunMap(t *template.Template, referenceTpls map[string]render
|
||||
funcMap["lookup"] = NewLookupFunction(e.config)
|
||||
}
|
||||
|
||||
// When DNS lookups are not enabled override the sprig function and return
|
||||
// an empty string.
|
||||
if !e.EnableDNS {
|
||||
funcMap["getHostByName"] = func(name string) string {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
t.Funcs(funcMap)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user