-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
Description
Eschewed features
- This issue is not requesting templating, unstuctured edits, build-time side-effects from args or env vars, or any other eschewed feature.
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
- I am interested in contributing this feature myself! 🎉
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.