Skip to content

feat: Add PlatformConfig and FeatureGates with hot-reloadable loaders - #110

Merged
pdettori merged 3 commits into
rossoctl:mainfrom
cwiklik:feat/config-types
Feb 12, 2026
Merged

pdettori merged 3 commits into
rossoctl:mainfrom
cwiklik:feat/config-types

Conversation

@cwiklik

@cwiklik cwiklik commented Feb 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add PlatformConfig and FeatureGates types with compiled defaults
  • Add ConfigLoader and FeatureGateLoader with YAML file loading, fsnotify hot-reload, thread-safe Get(), and OnChange() callbacks
  • Proper DeepCopy() for ResourceRequirements maps
  • Validate() for port ranges and required images

This is Phase 1 of 5 — purely additive new package, no existing code modified.

Test plan

  • go build ./... passes
  • go vet ./... passes
  • Review CompiledDefaults() values match current hardcoded constants in container_builder.go
  • Review DeepCopy() handles all map/slice fields

Part 1 of #109

🤖 Generated with Claude Code

@cwiklik cwiklik changed the title feat(webhook): add PlatformConfig and FeatureGates with hot-reloadable loaders feat: add PlatformConfig and FeatureGates with hot-reloadable loaders Feb 11, 2026
@cwiklik
cwiklik requested review from mrsabath and pdettori February 11, 2026 19:44
@cwiklik cwiklik added the enhancement New feature or request label Feb 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PlatformConfig type with validation, deep copy, and compiled defaults matching existing hardcoded values
  • Added FeatureGates type as a global kill switch for sidecar injection
  • Implemented ConfigLoader and FeatureGateLoader with 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 and others added 2 commits February 11, 2026 15:43
- 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]>
@cwiklik cwiklik changed the title feat: add PlatformConfig and FeatureGates with hot-reloadable loaders feat: Add PlatformConfig and FeatureGates with hot-reloadable loaders Feb 11, 2026

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@pdettori
pdettori merged commit 9e970fb into rossoctl:main Feb 12, 2026
4 of 5 checks passed
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants