Skip to content

pkg/securitypolicy: Trim whitespaces from version_{api,framework} to allow trailing newlines#2761

Merged
anmaxvl merged 1 commit into
microsoft:mainfrom
micromaomao:version-trim-ws
Jun 1, 2026
Merged

pkg/securitypolicy: Trim whitespaces from version_{api,framework} to allow trailing newlines#2761
anmaxvl merged 1 commit into
microsoft:mainfrom
micromaomao:version-trim-ws

Conversation

@micromaomao
Copy link
Copy Markdown
Member

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

…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 micromaomao requested a review from a team as a code owner June 1, 2026 09:27
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
@micromaomao micromaomao requested review from KenGordon and Copilot June 1, 2026 09:31
@micromaomao micromaomao marked this pull request as draft June 1, 2026 09:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 *Raw and derive trimmed apiVersion / frameworkVersion via strings.TrimSpace.
  • Update the version_api and version_framework embed 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.

@micromaomao micromaomao marked this pull request as ready for review June 1, 2026 09:33
@micromaomao micromaomao requested a review from Copilot June 1, 2026 09:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated 1 comment.

Comment thread pkg/securitypolicy/securitypolicy.go
@anmaxvl anmaxvl merged commit 395fa50 into microsoft:main Jun 1, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants