Bird
0
0

A Helm chart template uses this code:

medium📝 Troubleshoot Q7 of 15
Kubernetes - Helm Package Manager
A Helm chart template uses this code:
{{ .Values.image.tag | default "latest" }}

But the rendered manifest shows tag: with no value. What is the problem?
AThe <code>image.tag</code> key exists but is set to an empty string, so default is ignored.
BThe <code>default</code> function is used incorrectly and should be <code>or</code>.
CThe <code>image.tag</code> key is missing, so default should apply but does not.
DHelm templates do not support the <code>default</code> function.
Step-by-Step Solution
Solution:
  1. Step 1: Understand default function behavior

    The default function only applies if the value is missing or null, not if empty string.
  2. Step 2: Analyze the empty string case

    If image.tag is set but empty, default is ignored, resulting in empty output.
  3. Final Answer:

    The image.tag key exists but is set to an empty string, so default is ignored. -> Option A
  4. Quick Check:

    Empty string disables default function [OK]
Quick Trick: Default applies only if value missing or null, not empty string [OK]
Common Mistakes:
  • Assuming default works on empty strings
  • Confusing default with or operator
  • Believing Helm lacks default function

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes