Repository navigation
Conversation
fwiesel
force-pushed
the
config/cobra
branch
3 times, most recently
from
October 31, 2026 09:52
47e0676 to
5f023ef
Compare
A controller parameter should not need a central configuration registry. Let each module declare typed options and flags. Use cobra and viper for command-line parsing and environment values. Flags take precedence. Keep the chart environment values and document them in --help. Use native integer trait limits so malformed values fail during parsing. Keep concurrency guards and the existing certificate namespace wiring. Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
The manager reads its settings from the environment, so drop the --flag=$(ENV_VAR) container arguments. Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
settings now live next to their owning controllers, so adding a setting touches one file per controller plus the chart. Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
fwiesel
force-pushed
the
config/cobra
branch
from
November 13, 2026 20:48
dcfd50a to
3916e8c
Compare
Merging this branch will decrease overall coverage
Coverage detailsCompared to commit cfee313 (run #43438290245)
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.
Keep operator parameters in module-owned typed options structs.
Adding a parameter changes its module and the chart environment values,
not a central parameter registry.
Cobra and pflag parse the flags.
Viper supplies environment values.
Explicit flags take precedence.
--helpdocuments the environment names.Invalid configuration fails at startup.
Trait concurrency uses
map[string]intand nativeStringToIntVarparsing.Malformed integers fail during parsing. Validation rejects limits below 1
and empty or whitespace-padded trait names. The lowest matching limit wins,
with the default as the cap and a minimum result of 1.
The chart removes six
--flag=$(ENV_VAR)arguments in a separate commit.Alternative to #373, which uses go-flagsfiller instead of cobra and viper.
Existing tests retain the option wiring changes. No new repository tests.
Relates to #13.
Layout reduction round (2026-11-01)
Controller-owned options now live in their controller files:
internal/controller/eviction/controller.gointernal/controller/node_certificate_controller.gointernal/controller/hypervisor_controller.go(used by the manager and the Hypervisor controller only)The separate
internal/controller/eviction/options.go,internal/controller/options.go, andinternal/config/options.gofiles no longer exist.Churn vs PR base (added + deleted lines): 505 → 436.
Future settings: add the field (tag + default) to the owning options struct in its controller file — no central registration. Separate new semantic field groups with a blank line to keep reformatting churn low.