Repository navigation
Conversation
Kubernetes uses the environment as its configuration interface. Keep types, defaults, and domain validation in the owning modules so new fields need no command registry or central field-default edits. Decode the squashed aggregate once with generic map, list, and text hooks. Plain strings and explicit empty values keep their meaning. Use ordinary integer maps instead of a custom trait parser. Native environment maps use JSON. Nonempty TRAIT=N lists are unsupported and must migrate to JSON objects with double-quoted keys. Empty environment text clears a map. Validate effective domain limits before Kubernetes setup. Keep optional CLI registration and descriptions in the later commit. Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
The manager reads its settings from the environment, so remove the --flag=$(ENV_VAR) container arguments. Document JSON trait maps so chart users can migrate old TRAIT=N values to the native input form. Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
Operators need optional command-line inspection and overrides. Generate flags once from the aggregate so new supported fields in existing modules need no registration changes in cmd. Let sflags use native maps and lists rather than custom trait methods. Repeated TRAIT:N flags merge map keys. The last value for a repeated key wins, and unchanged environment keys remain. Old TRAIT=N CLI lists are unsupported and must migrate to repeated colon entries. Empty CLI map input is invalid, not a whole-map clear operation. Use empty environment text when the map must start empty. Keep descriptions here. Owning modules retain types and defaults. 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>
the value callback added no transformation, so the native key-only form is sufficient Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
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.
Read operator settings into module-owned options with
koanf. Each module supplies its defaults
through a constructor, including Shared. The command package contains no
module field-default literals or per-field registry.
The loader decodes one squashed aggregate. Generic hooks decode
comma-separated lists, JSON maps of the target type, and text-unmarshaler
types. Plain strings remain unchanged. Trait limits use an ordinary
map[string]int. The existingTraitConcurrencyname remains as an alias,without custom parsing or rendering methods.
Adding a supported field to an existing module needs no loader or flag
registration change in
cmd. New defaults belong in that module'sconstructor. Chart exposure and domain validation can require separate
changes. External overlays check Shared, certificate, and eviction fields,
including fresh mutable defaults, maps, lists, and text values.
The three commits keep these concerns separate:
--flag=$(ENV_VAR)chart arguments and document JSON maps.Description tags belong to the CLI commit. The chart commit remains separate
and reversible. Startup validation checks effective trait names and positive
limits before Kubernetes setup.
Native map forms and migration
Environment maps use JSON with double-quoted keys and integer values:
EVICTION_TRAIT_CONCURRENCY='{"CUSTOM_HANA_EXCLUSIVE_HOST":1,"CUSTOM_FOO":2}'CLI map entries use repeated colon flags:
CLI entries merge keys into the environment map. A repeated key retains its
last CLI value. Unchanged environment keys remain. Empty environment text
clears the initial map. Empty CLI map input is invalid and does not clear it.
Old nonempty
TRAIT=Nenvironment values and custom CLI lists are unsupported.They must migrate to JSON environment objects and repeated
TRAIT:NCLI flags.The former empty-CLI clear operation is no longer supported.
Existing repository tests and fixtures remain unchanged. No new tests are
committed. External native acceptance and reviewer probes check the actual
loader, aggregate flags, module ownership, validation, and chart encoding.
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.The env provider now uses the native key-only callback
env.Provider("", ".", strings.ToLower).Churn vs PR base (added + deleted lines): 537 → 471.
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.