test(docker): restore platform fixture image tag (#7239)

Restore the pre-existing foreign-platform fixture image tag or its original absence using the accepted PreservedImageTag helper. Preserve existing container architecture assertions and cleanup.

Signed-off-by: Andre Kurait <akurait@amazon.com>
This commit is contained in:
Andre Kurait authored and GitHub committed 2026-11-01 17:33:33 -04:00
1 parent 6ef50cbefc
commit c604f89164
1 file changed
+8
@@ -53,6 +53,14 @@ class ContainerPlatformDockerIntegrationTest {
.withCmd(List.of("uname", "-m"))
.build();
try (PreservedImageTag ignored = new PreservedImageTag(dockerClient,
IMAGE.substring(0, IMAGE.lastIndexOf(':')), IMAGE.substring(IMAGE.lastIndexOf(':') + 1))) {
createAndVerify(spec, platform, armHost, hostArchitecture, requestedArchitecture);
}
}
private void createAndVerify(ContainerSpec spec, String platform, boolean armHost, String hostArchitecture,
String requestedArchitecture) {
String containerId = null;
try {
containerId = lifecycleManager.create(spec, platform);