mirror of https://github.com/kubernetes/kops.git
use sprig join for template functions
This commit is contained in:
parent
591fbf856a
commit
5a3ed44773
|
|
@ -77,13 +77,13 @@ data:
|
|||
ttl 30
|
||||
}
|
||||
{{- if GossipDomains }}
|
||||
hosts /rootfs/etc/hosts {{ join GossipDomains " " }} {
|
||||
hosts /rootfs/etc/hosts {{ join " " GossipDomains }} {
|
||||
ttl 30
|
||||
fallthrough
|
||||
}
|
||||
{{- end }}
|
||||
prometheus :9153
|
||||
forward . {{ or (join KubeDNS.UpstreamNameservers " ") "/etc/resolv.conf" }} {
|
||||
forward . {{ or (join " " KubeDNS.UpstreamNameservers) "/etc/resolv.conf" }} {
|
||||
max_concurrent 1000
|
||||
}
|
||||
cache 30
|
||||
|
|
|
|||
|
|
@ -91,9 +91,6 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
|
|||
dest["replace"] = func(s, find, replace string) string {
|
||||
return strings.Replace(s, find, replace, -1)
|
||||
}
|
||||
dest["join"] = func(a []string, sep string) string {
|
||||
return strings.Join(a, sep)
|
||||
}
|
||||
dest["joinHostPort"] = net.JoinHostPort
|
||||
|
||||
sprigTxtFuncMap := sprig.TxtFuncMap()
|
||||
|
|
@ -103,6 +100,7 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
|
|||
dest["trimPrefix"] = sprigTxtFuncMap["trimPrefix"]
|
||||
dest["semverCompare"] = sprigTxtFuncMap["semverCompare"]
|
||||
dest["ternary"] = sprigTxtFuncMap["ternary"]
|
||||
dest["join"] = sprigTxtFuncMap["join"]
|
||||
|
||||
dest["ClusterName"] = tf.ClusterName
|
||||
dest["WithDefaultBool"] = func(v *bool, defaultValue bool) bool {
|
||||
|
|
|
|||
Loading…
Reference in New Issue