fix: read srt-settings merge source from Secret data, not stringData#205
Merged
Conversation
The API server folds stringData into data during v1-to-internal
conversion, before admission webhooks run, so the kagent-srt-settings
Kyverno policy always saw an empty merge source and replaced the
controller-generated srt-settings.json with the
enableWeakerNestedSandbox flag alone. srt rejected the resulting file
(network: Required, filesystem: Required), breaking sandboxed skill
execution and leaving agents without their muster MCP tools.
Read the existing JSON from data with base64_decode (falling back to
base64 '{}') so the merge preserves the controller's network and
filesystem sections. Verified on gazelle: with the patched policy, a
kagent-controller restart rewrote the sre-agent Secret to the full
merged settings.
QuentinBisson
marked this pull request as ready for review
July 17, 2026 12:07
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.
What
The
kagent-srt-settingsKyverno policy now reads the existingsrt-settings.jsonfrom the agent config Secret'sdata(base64-decoded, falling back to base64{}) instead ofrequest.object.stringData.Why
The policy is meant to merge
enableWeakerNestedSandbox: trueinto the srt settings the kagent controller generates. But the API server foldsstringDataintodataduring v1-to-internal conversion (Convert_v1_Secret_To_core_Secret), before admission webhooks run, so the policy's merge source was always empty. The mutation then replaced the controller's full settings with the flag alone:{"enableWeakerNestedSandbox":true}srt rejects that file (
Invalid configuration in /config/srt-settings.json: network: Required, filesystem: Required), which breaks sandboxed skill execution and leaves agents without their muster MCP tools ("Tool not found" onfilter_tools/call_tool/describe_tool). Only kagent built-ins remained available.Reproduced on gazelle with server-side dry-runs: both CREATE and UPDATE of the Secret carrying full settings in
stringDatacame back from admission flag-only.Verification
Applied the patched policy live on gazelle:
{"enableWeakerNestedSandbox":true,"filesystem":{...},"network":{...}}kagent/sre-agentSecret was rewritten with the full merged settings and the file is correct inside the running pod.Rollout note
Kyverno mutation is admission-time only: existing agent config Secrets stay broken until their next write. Restart the kagent controller after deploying to force a rewrite; the agent pods then need a restart to rebuild their tool registry.