Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

416
Vistas
HELM: How to convert a string into lower/upper case inside if-else condition?

Use case: I have values.yaml where I have a field mode.

Values.yaml

mode: start

or user can enter a value for the field mode in any of the below mentioned ways:

mode: STart or START or sTart

Now, I have a file where I am using an if condition as shown below:

command: {{ if eq .Values.mode "start" }} do this {{ esle }} do that {{ end }}

Now, my challenge is how can I covert the ".Values.mode" into lower alphabets before doing the comparison. I have tried the below mentioned ways:

1.

{{ if eq .Values.mode | lower "start" }} do this {{ esle }} do that {{ end }}
{{ if eq lower .Values.mode "start" }} do this {{ esle }} do that {{ end }}

Both of the above methods errored out.

Note: we are using a third-party tool, hence JSON schema check won't help me.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

lower is a function handed to you in the templates. It has a return value, which you wish to compare to another value.

Simply group the function call of lower with parenthesis:

{{ if eq "start" (lower .Values.mode) }} do this {{ else }} do that {{ end }}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda