k8wiz
Helm
Hard
Templates

In a Helm 4.3 template, what does durationSeconds return when its input can't be parsed, such as "45 s"?

Select your answer:

Show answer and explanation

Answer: 0, and the template keeps rendering without error

Explanation

The Helm 4.3 duration helpers such as durationSeconds and durationMilliseconds return 0 on a parse error. Only mustToDuration fails the render, so pipe a value through mustToDuration first when a silent 0 would be dangerous, for example in terminationGracePeriodSeconds.

Read more about Helm