Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

415
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!