Skip to content

Conversation

locnnil
Copy link
Contributor

@locnnil locnnil commented Jul 15, 2025

Description

  • The test has an inconsistency, it saves an image get from docker hub on a tar file and immediately tries to load it back, which doesn't make sense because this operation will be cached/ignored.

  • This adds a removal of the image before trying to load the tar file.

Documentation

Tests

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>
@locnnil locnnil changed the title BugFix(docker/save-and-load): remove image before try to load it again BugFix for docker/save-and-load remove image before try to load it again Jul 15, 2025
@locnnil locnnil changed the title BugFix for docker/save-and-load remove image before try to load it again BugFix(docker/save-and-load): remove image before try to load it again (Bugfix) Jul 15, 2025
@locnnil locnnil changed the title BugFix(docker/save-and-load): remove image before try to load it again (Bugfix) BugFix for docker/save-and-load remove image before try to load it again (BugFix) Jul 15, 2025
@locnnil locnnil marked this pull request as ready for review July 15, 2025 15:11
@Hook25
Copy link
Collaborator

Hook25 commented Jul 16, 2025

Hello, thanks for this, please provide at least a submission to prove this works

@Hook25 Hook25 self-assigned this Jul 16, 2025
@Hook25 Hook25 added the waiting-for-changes The review has been completed but the PR is waiting for changes from the author label Jul 16, 2025
- fix: stop using I/O redirection
    During docker save command, the `ubuntu.tar` file saved was actually an
    empty file. After changing the save operation to use `-i` the test still failing.
    Then after changing the load operation to not use the redirection it worked.

- feat: Prune image before load back
    Delete all image layers before trying to load

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>
@locnnil
Copy link
Contributor Author

locnnil commented Aug 8, 2025

@Hook25 At first when I tried to run with my change it didn't work.

Then I revert it, but still, it doesn't work.

After investigating, I saw that the IO redirection for the save and load command weren't working inside Checkbox. Outside it works fine.

So I changed the method to use to save and load the tarball, and now the tests passes.

Here is the requested submission:
https://certification.canonical.com/hardware/202203-30003/submission/442561/

@Hook25
Copy link
Collaborator

Hook25 commented Aug 11, 2025

Interesting, it is really weird that it doesn't work inside of Checkbox that command, it looks good to me. Either way, thanks for fixing it.

@Hook25 Hook25 merged commit ff16599 into canonical:main Aug 11, 2025
14 checks passed
@locnnil locnnil deleted the fix-save-load-test branch August 11, 2025 11:42
bladernr pushed a commit that referenced this pull request Aug 28, 2025
…ain (BugFix) (#2018)

* Fix(docker/save-and-load): remove image before try to load it again

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>

* fix: I/O redirection operators not working for docker save and load

- fix: stop using I/O redirection
    During docker save command, the `ubuntu.tar` file saved was actually an
    empty file. After changing the save operation to use `-i` the test still failing.
    Then after changing the load operation to not use the redirection it worked.

- feat: Prune image before load back
    Delete all image layers before trying to load

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>

---------

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>
stanley31huang pushed a commit that referenced this pull request Oct 3, 2025
…ain (BugFix) (#2018)

* Fix(docker/save-and-load): remove image before try to load it again

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>

* fix: I/O redirection operators not working for docker save and load

- fix: stop using I/O redirection
    During docker save command, the `ubuntu.tar` file saved was actually an
    empty file. After changing the save operation to use `-i` the test still failing.
    Then after changing the load operation to not use the redirection it worked.

- feat: Prune image before load back
    Delete all image layers before trying to load

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>

---------

Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-for-changes The review has been completed but the PR is waiting for changes from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants