Skip to content

Validate runhcs sandbox isolation and platform#2473

Merged
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:jc-isolateion
Jul 10, 2025
Merged

Validate runhcs sandbox isolation and platform#2473
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:jc-isolateion

Conversation

@helsaawy
Copy link
Copy Markdown
Contributor

@helsaawy helsaawy commented Jul 9, 2025

Check that the OCI spec correctly identifies the OS and isolation type specified in the "runhcsopts".Options.

Make "oci".IsJobContainer check if it is an WCOW pod, so spurious host process container annotations are ignored for LCOW.

@helsaawy helsaawy requested a review from a team as a code owner July 9, 2025 21:03
Check that the OCI spec correctly identifies the OS and isolation type
specified in the `"runhcsopts".Options`.

Make `"oci".IsJobContainer` check if it is an WCOW pod, so
spurious host process container annotations are ignored for LCOW.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
@helsaawy helsaawy merged commit c9ae50d into microsoft:main Jul 10, 2025
19 checks passed
@helsaawy helsaawy deleted the jc-isolateion branch July 10, 2025 17:57
rzlink added a commit to rzlink/hcsshim that referenced this pull request Mar 2, 2026
When runtime options are non-empty (e.g., SandboxIsolation is set) but
SandboxPlatform is empty, infer the platform from the OCI spec rather
than failing validation. This matches the existing behavior when options
are entirely empty.

containerd's default config (config_windows.go) sets SandboxIsolation=1
for the runhcs-wcow-hypervisor runtime handler but omits SandboxPlatform,
making options non-empty with an empty platform string. This causes
platforms.Parse("") to fail with 'invalid runtime sandbox platform'.

The OCI spec already contains sufficient information to determine the
platform: spec.Linux != nil indicates LCOW, while spec.Windows != nil
with spec.Linux == nil indicates WCOW.

Fixes the interaction between containerd's default runtime config and
hcsshim's strict validation added in PR microsoft#2473.
rzlink added a commit to rzlink/hcsshim that referenced this pull request Mar 4, 2026
When runtime options are non-empty (e.g., SandboxIsolation is set) but
SandboxPlatform is empty, infer the platform from the OCI spec rather
than failing validation. This matches the existing behavior when options
are entirely empty.

containerd's default config (config_windows.go) sets SandboxIsolation=1
for the runhcs-wcow-hypervisor runtime handler but omits SandboxPlatform,
making options non-empty with an empty platform string. This causes
platforms.Parse("") to fail with 'invalid runtime sandbox platform'.

The OCI spec already contains sufficient information to determine the
platform: spec.Linux != nil indicates LCOW, while spec.Windows != nil
with spec.Linux == nil indicates WCOW.

Fixes the interaction between containerd's default runtime config and
hcsshim's strict validation added in PR microsoft#2473.
rzlink added a commit to rzlink/hcsshim that referenced this pull request Mar 4, 2026
When runtime options are non-empty (e.g., SandboxIsolation is set) but
SandboxPlatform is empty, infer the platform from the OCI spec rather
than failing validation. This matches the existing behavior when options
are entirely empty.

containerd's default config (config_windows.go) sets SandboxIsolation=1
for the runhcs-wcow-hypervisor runtime handler but omits SandboxPlatform,
making options non-empty with an empty platform string. This causes
platforms.Parse("") to fail with 'invalid runtime sandbox platform'.

The OCI spec already contains sufficient information to determine the
platform: spec.Linux != nil indicates LCOW, while spec.Windows != nil
with spec.Linux == nil indicates WCOW.

Fixes the interaction between containerd's default runtime config and
hcsshim's strict validation added in PR microsoft#2473.
rzlink added a commit to rzlink/hcsshim that referenced this pull request Mar 4, 2026
When runtime options are non-empty (e.g., SandboxIsolation is set) but
SandboxPlatform is empty, infer the platform from the OCI spec rather
than failing validation. This matches the existing behavior when options
are entirely empty.

containerd's default config (config_windows.go) sets SandboxIsolation=1
for the runhcs-wcow-hypervisor runtime handler but omits SandboxPlatform,
making options non-empty with an empty platform string. This causes
platforms.Parse("") to fail with 'invalid runtime sandbox platform'.

The OCI spec already contains sufficient information to determine the
platform: spec.Linux != nil indicates LCOW, while spec.Windows != nil
with spec.Linux == nil indicates WCOW.

Fixes the interaction between containerd's default runtime config and
hcsshim's strict validation added in PR microsoft#2473.

Signed-off-by: Dawei Wei <wei.dawei.cn@gmail.com>
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