Skip to content

Commit 6a92183

Browse files
committed
pass --platform to docker save for kind helper images
Plain `docker save` of a multi-arch tag under Docker's containerd image store exports an OCI index referencing every platform and, for indices with several platforms (e.g. cert-manager-controller v1.20.2 has 5), can omit the selected platform's config blob from the tar. This made `ctr images import --platform=linux/amd64` fail in kind-up with: ctr: failed to resolve rootfs: content digest sha256:...: not found Pass the same `--platform` to `docker save` (Docker 28+/API 1.48+) so the archive is a self-contained single-platform OCI image.
1 parent 76a5b5b commit 6a92183

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

installer/src/nv_config_manager_installer/deployer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,11 +1350,18 @@ def _load_kind_helper_image(
13501350
step: DeployStep,
13511351
) -> None:
13521352
"""Load a helper image into Kind node containerd for one platform."""
1353+
# Pass --platform to `docker save` so the OCI archive only contains the
1354+
# selected platform's index/manifest/config/layers. With Docker's
1355+
# containerd image store, a plain `docker save` of a multi-arch tag
1356+
# exports an index that still references the other platforms (and may
1357+
# even drop the selected platform's config blob), causing
1358+
# `ctr images import` to later fail with
1359+
# `failed to resolve rootfs: content digest ...: not found`.
13531360
nodes = _kind_node_names(cluster)
13541361
for node in nodes:
13551362
self.callback.on_log(f"Loading helper image {image} into Kind node {node}...")
13561363
_run_logged_pipe(
1357-
["docker", "save", image],
1364+
["docker", "save", "--platform", platform_name, image],
13581365
[
13591366
"docker",
13601367
"exec",

installer/tests/test_deployer.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def fake_run_logged_pipe(source_cmd, sink_cmd, step, callback, **kwargs):
607607
] in logged_commands
608608
assert ["kind", "get", "nodes", "--name", "test-cluster"] in run_commands
609609
assert (
610-
["docker", "save", LOADER_POD_IMAGE],
610+
["docker", "save", "--platform", "linux/amd64", LOADER_POD_IMAGE],
611611
[
612612
"docker",
613613
"exec",
@@ -677,7 +677,13 @@ def fake_run_logged_pipe(source_cmd, sink_cmd, step, callback, **kwargs):
677677
"docker.io/library/redis:7-alpine",
678678
] in logged_commands
679679
assert (
680-
["docker", "save", "docker.io/library/redis:7-alpine"],
680+
[
681+
"docker",
682+
"save",
683+
"--platform",
684+
"linux/amd64",
685+
"docker.io/library/redis:7-alpine",
686+
],
681687
[
682688
"docker",
683689
"exec",

0 commit comments

Comments
 (0)