最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

helmfile - Helm-chart template convert to uppercase - Stack Overflow

programmeradmin0浏览0评论

Is there a way to use the same _helper.tpl function and convert in to upper/lower whithin the helm-chart yaml files?

_helper.tpl:

{{- define "hostnameparts.name" -}}
  {{$hostnameparts := "hostname" -}}
  {{- $joinedHostname := join "-" $hostnameparts  -}}
  {{- printf "%s" $joinedHostname -}}
{{- end -}}

helm-chart yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "hostnameparts.name" . }}
  labels:
    host.upper: {{ template "hostnameparts.name" . }}
    host.lower: {{ template "hostnameparts.name" . }}

I tried to use without any luck:

{{ upper template "hostnameparts.name" . }}
{{ template "hostnameparts.name" . | upper }}

helm template . errors:

Error: parse error at (deployment.yaml:xx): unexpected <template> in operand
Error: parse error at (deployment.yaml:xx): unexpected <template> in parenthesized pipeline
发布评论

评论列表(0)

  1. 暂无评论