Commit 25e49d5
committed
shim: infer SandboxPlatform from OCI spec when not explicitly set
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 #2473.1 parent cd32b44 commit 25e49d5
1 file changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
133 | 151 | | |
134 | | - | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
137 | 155 | | |
| |||
0 commit comments