Files
velero/changelogs/unreleased
Kaizhe HuangandGitHub 0f54eefe6f
e2e-test-kind.yaml / extract (push) Failing after 9s
Run the E2E test on kind / get-go-version (push) Failing after 10s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / setup-test-matrix (push) Failing after 3s
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 6s
Main CI / get-go-version (push) Failing after 6s
Main CI / Build (push) Skipped
Scorecard supply-chain security / Scorecard analysis (push) Skipped
Fix unchecked type assertion panic in ChangeImageNameAction (#10574)
* Fix unchecked type assertion panic in ChangeImageNameAction

replaceImageName reads a restored container's image field out of the
unstructured object and asserts it to string without checking ok. The
comma-ok map lookup on the line above only confirms the "image" key is
present -- it says nothing about the value's type. A restored resource
whose image field is present but not a JSON string (e.g. a number,
bool, null, array, or object) causes an unrecovered
"interface conversion: interface {} is not string" panic in this
RestoreItemAction plugin whenever the optional image-remapping
ConfigMap feature is configured.

Switch to the comma-ok form of the assertion and skip (with a log
message) any container whose image field isn't a string, instead of
panicking.

Signed-off-by: Kaizhe Huang <derek0405@gmail.com>

* Add regression test for non-string image field panic

Covers the comma-ok assertion fix: replaceImageName operates on
generic unstructured content decoded from a backup tarball, which
isn't validated against the Pod schema before this code runs, so
"image" isn't guaranteed to be a string.

Signed-off-by: Kaizhe Huang <derek0405@gmail.com>

* Guard container-entry type assertion, use unstructured.NestedString

Addresses reviewer feedback: container.(map[string]any) was also an
unchecked assertion, and unstructured.NestedString gives safer,
more idiomatic type-checking than a manual comma-ok assertion. Also
switches the skip-path logging from Info to Warn per review.

Signed-off-by: Kaizhe Huang <derek0405@gmail.com>

---------

Signed-off-by: Kaizhe Huang <derek0405@gmail.com>
2026-09-28 15:29:50 +08:00
..
2026-02-24 23:17:03 +08:00
2026-03-02 10:49:14 +11:00
2026-03-19 02:38:11 +05:30
2026-03-24 20:49:16 +05:30
2026-04-17 15:38:44 +08:00
2026-04-21 14:14:24 +08:00
2026-04-28 03:11:49 -04:00
2026-05-22 06:26:40 +00:00
2026-05-27 14:59:16 +08:00
2026-05-28 14:41:54 +08:00
2026-06-03 13:23:08 +08:00
2026-06-16 17:47:21 +08:00
2026-06-18 15:39:44 +08:00
2026-07-11 10:09:39 +08:00
2026-07-17 16:35:19 +08:00
2026-08-06 10:52:03 +05:30
2026-08-13 12:21:20 -04:00
2026-08-12 22:49:21 +08:00
2026-08-27 12:57:20 -04:00
2026-09-08 18:15:34 +08:00
2026-09-10 18:39:04 +05:30
2026-09-12 11:41:04 +03:00
2026-09-17 11:13:18 +08:00
2026-09-21 07:37:08 -07:00