test(translator): tighten skills security context assertions#2005
Open
mesutoezdil wants to merge 5 commits into
Open
test(translator): tighten skills security context assertions#2005mesutoezdil wants to merge 5 commits into
mesutoezdil wants to merge 5 commits into
Conversation
skills init container handles loading, main container does not need privileged=true. only BashTool (cfg.GetExecuteCode) needs it. fixes kagent-dev#1997 Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Reduce multi-line comments to single lines. Replace the weak if-not-nil guard with a direct assert.Nil so the test actually fails when the security context is unexpectedly set. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the agent manifest translation and tests to avoid setting privileged container security context when skills are configured.
Changes:
- Removed
securityContext.privileged=truefrom skills-related golden manifest outputs. - Updated security context tests to assert that skills do not introduce a container security context by default.
- Refactored
buildSkillsRuntimeto no longer mutateneedCodeExecIsolationvia a pointer parameter.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go/core/internal/controller/translator/agent/testdata/outputs/agent_with_skills.json | Updates golden output to remove privileged container security context. |
| go/core/internal/controller/translator/agent/testdata/outputs/agent_with_git_skills.json | Updates golden output to remove privileged container security context. |
| go/core/internal/controller/translator/agent/security_context_test.go | Adjusts test expectation: skills should not set a container security context. |
| go/core/internal/controller/translator/agent/manifest_builder.go | Removes needCodeExecIsolation mutation from buildSkillsRuntime API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
if containerSecurityContext != nilguard withassert.Nilso the test fails when a security context is unexpectedly set.TestSecurityContext_SkillsNoPrivilegedandTestSecurityContext_SkillsPSSRestricted.TestSecurityContext_SkillsPSSRestrictedcomment.