Eschewed features
What would you like to have added?
Add a kustomize build flag to treat warnings as errors, i.e. return a non-zero exit code if warnings are emitted.
Suggested UX:
kustomize build <dir> --warnings-as-errors
Why is this needed?
In CI, warnings (especially deprecations) should be enforceable as policy failures. Today kustomize build can print warnings but still exit 0, so pipelines can go green while accumulating deprecations and future breakage.
Example warning observed:
# Warning: 'vars' is deprecated. Please use 'replacements' instead. ...
Can you accomplish the motivating task without this feature, and if so, how?
Yes, but it’s brittle: capture stdout+stderr and fail if the output contains warning markers (e.g. ^# Warning:). This depends on message formatting and is easy to break if wording/prefixes change.
What other solutions have you considered?
None.
Anything else we should know?
- Warnings are currently mixed into build output, which makes reliable machine parsing awkward.
- The requested change should not alter default behavior; only fail on warnings when the flag is provided.
Feature ownership
Eschewed features
What would you like to have added?
Add a
kustomize buildflag to treat warnings as errors, i.e. return a non-zero exit code if warnings are emitted.Suggested UX:
kustomize build <dir> --warnings-as-errorsWhy is this needed?
In CI, warnings (especially deprecations) should be enforceable as policy failures. Today
kustomize buildcan print warnings but still exit0, so pipelines can go green while accumulating deprecations and future breakage.Example warning observed:
# Warning: 'vars' is deprecated. Please use 'replacements' instead. ...Can you accomplish the motivating task without this feature, and if so, how?
Yes, but it’s brittle: capture stdout+stderr and fail if the output contains warning markers (e.g.
^# Warning:). This depends on message formatting and is easy to break if wording/prefixes change.What other solutions have you considered?
None.
Anything else we should know?
Feature ownership