Repository navigation
feat: Add PlatformConfig and FeatureGates with hot-reloadable loaders - #110
Merged
Merged
Conversation
cwiklik
force-pushed
the
feat/config-types
branch
from
February 11, 2026 19:25
d80f3f7 to
7b16e3c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces Phase 1 of a 5-phase configuration externalization system for the kagenti-webhook. It adds a new config package with PlatformConfig and FeatureGates types that support hot-reloading from YAML files via fsnotify watchers. The implementation provides thread-safe access through mutex-protected getters and supports change notification callbacks.
Changes:
- Added
PlatformConfigtype with validation, deep copy, and compiled defaults matching existing hardcoded values - Added
FeatureGatestype as a global kill switch for sidecar injection - Implemented
ConfigLoaderandFeatureGateLoaderwith fsnotify-based hot-reload, thread-safe operations, and callback mechanisms
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| kagenti-webhook/internal/webhook/config/types.go | Core configuration types with DeepCopy and validation methods |
| kagenti-webhook/internal/webhook/config/loader.go | ConfigLoader implementation with file watching and hot-reload |
| kagenti-webhook/internal/webhook/config/feature_gates.go | FeatureGates type definition with DeepCopy |
| kagenti-webhook/internal/webhook/config/feature_gate_loader.go | FeatureGateLoader implementation with file watching and hot-reload |
| kagenti-webhook/internal/webhook/config/defaults.go | Compiled default values matching existing container_builder.go constants |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…oaders Add the config foundation for externalizing sidecar injection settings. This is Phase 1 of the externalize-config epic (rossoctl#109) — purely additive, no existing code is modified. - PlatformConfig: images, proxy ports/UID, resource limits, sidecar defaults - FeatureGates: global kill switch + per-sidecar gates - ConfigLoader/FeatureGateLoader: YAML file loading, fsnotify watch with debounce, thread-safe Get() returning DeepCopy, OnChange callbacks - CompiledDefaults()/DefaultFeatureGates(): hardcoded fallbacks - DeepCopy properly handles ResourceList maps (resource.Quantity.DeepCopy) - Validate() checks port ranges and required image fields Part 1 of rossoctl#109 Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: cwiklik <[email protected]>
cwiklik
force-pushed
the
feat/config-types
branch
from
February 11, 2026 20:12
7b16e3c to
b683298
Compare
- Stop debounce timer on goroutine exit to prevent callbacks firing after watcher cleanup - Pass DeepCopy to onChange callbacks to prevent mutation of internal state (consistent with Get() pattern) - Protect onChange slice with mutex for thread-safe registration and snapshot-under-lock iteration in Load() - Update currentConfig/current on file-not-found to revert stale state when config file is deleted Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: cwiklik <[email protected]>
Validate InboundProxyPort and AdminPort alongside Proxy.Port, and require all container image references (proxyInit, spiffeHelper, clientRegistration) in addition to envoyProxy. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: cwiklik <[email protected]>
This was referenced Feb 12, 2026
boazdavid
added a commit
that referenced
this pull request
Nov 25, 2026
v0.7.9 adds lifecycle.Finish (context-guru #1359), which the next commit uses, and agent.Client.SubagentID (#1318). It requires accountant v0.7.0 (accountant #110: a cache rewrite is charged to the new change at the first difference), so every module that lists the accountant moves too. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
boazdavid
added a commit
that referenced
this pull request
Nov 26, 2026
v0.7.9 adds lifecycle.Finish (context-guru #1359), which the next commit uses, and agent.Client.SubagentID (#1318). It requires accountant v0.7.0 (accountant #110: a cache rewrite is charged to the new change at the first difference), so every module that lists the accountant moves too. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
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.
Summary
PlatformConfigandFeatureGatestypes with compiled defaultsConfigLoaderandFeatureGateLoaderwith YAML file loading, fsnotify hot-reload, thread-safeGet(), andOnChange()callbacksDeepCopy()forResourceRequirementsmapsValidate()for port ranges and required imagesThis is Phase 1 of 5 — purely additive new package, no existing code modified.
Test plan
go build ./...passesgo vet ./...passesCompiledDefaults()values match current hardcoded constants incontainer_builder.goDeepCopy()handles all map/slice fieldsPart 1 of #109
🤖 Generated with Claude Code