Draft
Conversation
# Conflicts: # admin/go.sum # common/go.mod # common/go.sum # common/pkg/config/config.go # common/pkg/config/env_test.go # notification/go.mod # notification/go.sum
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.
Important
This feature is currently postponed and will be picked up at a later date.
MR Summary: Migrate admin and notification to file-based config
Goal
Migrate the admin and notification controller configs from environment-variable-based configuration (
envFrom+.cfgfiles) to the new YAML config-file-based configuration. The controllers now read config from/etc/controlplane/config/config.yaml, mounted as a ConfigMap (admin) or Secret (notification).Key technical finding
defaultConfig()pre-populates the struct with all defaults fromdefaults.gov.UnmarshalExact()uses mapstructure v2 which only overwrites fields present in the YAML -- absent fields are skipped and retain their defaultsUnmarshalExactadditionally rejects unknown keys (catches typos)Why kustomize merge/patches don't work for this
The
data["config.yaml"]field is an opaque string from kustomize's perspective.behavior: mergeonly merges at the data-key level, therefore merge replaces the entire value. This is why the Go-side default merging is the correct solution.Open problems
secret-manager and file-manager use common-server, not common
The current solution is built around the
commonpackage's config (common/pkg/config) and therefore for the config required fro reconcilers and operators. However, secret-manager and file-manager usecommon-serveras their base library but would prefer the optimized output.Central/shared config values across controllers
There is currently no solution for configuration values that are shared across all controllers (e.g. tracing URLs, common infrastructure endpoints). Each controller's config file is independent -- there is no mechanism to define a value once and have it applied to all controllers.
This is an architectural question that was not addressed in this spike.
What was NOT completed / other gaps
.cfgapproach and have not been migrated