Open
Conversation
Contributor
Author
|
@MahatiC , FYI |
167d9d6 to
0ea3dc7
Compare
helsaawy
approved these changes
Mar 23, 2026
msscotb
approved these changes
Mar 23, 2026
Contributor
msscotb
left a comment
There was a problem hiding this comment.
Missing tests which led to this problem. Known issue that unit tests are needed.
Should have a PR description.
Fix missing response to shim when injecting SecurityPolicyFragment via ModifySettings in the GCS sidecar. Previously, the PolicyFragment handler in `modifySettings` returned the result of `InjectFragment` directly. On success (`nil` error), no response was sent to the shim and the request was not forwarded to the inbox GCS, leaving the shim's bridge RPC blocked waiting for a response that never arrived. After the 5-minute bridge timeout, the connection would be killed. Changes: - Send an explicit success response to the shim after `InjectFragment` succeeds, matching the pattern used by other sidecar-handled resource types (e.g. `ResourceTypeSecurityPolicy`). - Add `ResourceTypePolicyFragment` to the unmarshaling switch in `unmarshalContainerModifySettings` so the fragment payload is properly deserialized before reaching the handler. - Fix "invald" -> "invalid" typo in error messages. Signed-off-by: Maksim An <maksiman@microsoft.com> Co-authored-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
0ea3dc7 to
fb2fa5c
Compare
Add unit tests for the `modifySettings` handler in the GCS sidecar, covering the `PolicyFragment` response behavior that was fixed in the previous commit. Tests added: - `TestModifySettings_PolicyFragment_InvalidFragment` - invalid base64 fragment returns an error. - `TestModifySettings_PolicyFragment_SuccessResponse` - regression test verifying a success response is sent to sendToShimCh with correct message ID and Result=0. - `TestModifySettings_SecurityPolicy_SendsResponse` - reference test for the SecurityPolicy handler's response pattern. - `TestModifySettings_NetworkNamespace_ForwardedToGCS` - non-intercepted resource types are forwarded to GCS, not responded to directly. - `TestModifySettings_PolicyFragment_ErrorDoesNotSendResponse` - failed COSE validation returns error without sending a direct response. - `TestModifySettings_PolicyFragment_TypeAssertionFailure` - empty fragment returns an error. Also adds `buildModifySettingsRequest` and `newTestBridge` test helpers for constructing handler test fixtures. Signed-off-by: Maksim An <maksiman@microsoft.com>
fb2fa5c to
dfbcda0
Compare
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.
Uh oh!
There was an error while loading. Please reload this page.