pkg/securitypolicy: Trim whitespaces from version_{api,framework} to allow trailing newlines#2761
Merged
Merged
Conversation
…allow trailing newlines This makes it less likely that things break because a trailing newline is added by a code editor. Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>
micromaomao
added a commit
to micromaomao/hcsshim
that referenced
this pull request
Jun 1, 2026
A "BlockDev" mount (as introduced by microsoft#2168) is a special type of MappedVirtualDisk mount request, in which the GCS just creates a symlink at the requested target path pointing at the underlying `/dev/sdX`, and can later be consumed by a container by bind-mounting that symlink in the OCI spec. C-ACI does not currently use this feature, so the framework rejects both `mount_blockdev` and `unmount_blockdev` by default. An allow all policy will still let it through, which is useful for testing. Assisted-by: GitHub Copilot:claude-opus-4.7 Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com> Depends-on: microsoft#2559 Depends-on: microsoft#2761
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR makes embedded security policy version strings resilient to trailing whitespace/newlines and adjusts the embedded version files accordingly.
Changes:
- Rename embedded version variables to
*Rawand derive trimmedapiVersion/frameworkVersionviastrings.TrimSpace. - Update the
version_apiandversion_frameworkembed files (likely formatting/EOL normalization) to align with the new trimming behavior.
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/securitypolicy/securitypolicy.go | Trims embedded version strings at init time to tolerate editor-added newlines/whitespace. |
| pkg/securitypolicy/version_framework | Version file update (format/EOL normalization) to work cleanly with trimmed reads. |
| pkg/securitypolicy/version_api | Version file update (format/EOL normalization) to work cleanly with trimmed reads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
anmaxvl
approved these changes
Jun 1, 2026
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.
This makes it less likely that things break because a trailing newline is added
by a code editor.
Signed-off-by: Tingmao Wang tingmaowang@microsoft.com