Repository navigation
Conversation
Kubernetes uses the environment as the primary configuration interface. Module-owned options keep each environment name and default with its field. kelseyhightower/envconfig fills these structs at startup. An explicitly empty environment value takes effect without a default. Parse trait limits as positive decimal integers before duplicate entries can hide an invalid value. Reject the complete input without replacing the previous map. Keep controller validation and concurrency guards for options that callers construct directly. Keep flag descriptions and value rendering in the later CLI commit so this commit depends only on envconfig for configuration parsing. Signed-off-by: Fabian Wiesel <[email protected]>
The manager reads its settings from the environment, so drop the --flag=$(ENV_VAR) container arguments. The deployment template already sets these environment variables natively. Signed-off-by: Fabian Wiesel <[email protected]>
Operators can still inspect and override the settings from the command line. The flags are generated from the same options structs with sflags, and the env-derived values become their defaults, so the precedence is command line, then environment, then the built-in default. This keeps the flag names, descriptions and defaults that the chart used before it passed the settings via the environment. Signed-off-by: Fabian Wiesel <[email protected]>
fwiesel
force-pushed
the
config/envconfig
branch
from
October 31, 2026 09:54
8c815ee to
9219fa2
Compare
Merging this branch will decrease overall coverage
Coverage detailsCompared to commit f5172c4 (run #41086905849)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parse the operator configuration into module-owned options structs filled from
environment variables by
kelseyhightower/envconfig, so
introducing a parameter only touches the options struct and the chart's env
values: the env name, the default and the description live in the struct tags,
and invalid values fail once at startup with an error naming the setting. An
explicitly set but empty environment variable takes effect instead of silently
falling back to the default. The chart drops the
--flag=$(ENV_VAR)argumentsin a separate, revertable commit.
Trait concurrency limits use integer values. The parser requires positive
decimal integers in every
TRAIT=Nentry. An invalid entry rejects the wholeinput without replacing the previous map, even if a valid duplicate follows.
Valid duplicates keep the last value. Environment input must parse before CLI
flags can override it.
A separate commit re-adds the optional CLI flags via
sflags, generated from the same options
structs with the environment values as the flag defaults. The precedence is
command line, then environment, then built-in default. This commit also owns
the
desctags and the trait value'sString()andType()methods.Existing tests are updated for the option wiring; no new tests.
Relates to #13.