Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: track localImages in a new map to enable proper cleanup (runfinc…
…h#133) Issue #, if available: See https://github.com/runfinch/finch/actions/runs/8424406162/job/23068204038?pr=825#step:10:5839 ``` time="2024-03-25T17:50:43Z" level=info msg="trying next host" error="failed to do request: Head \"http://localhost:51261/v2/docker/library/alpine/manifests/latest\": dial tcp [::1]:51261: connect: connection refused" host="localhost:51261" time="2024-03-25T17:50:43Z" level=error msg="server \"localhost:51261\" does not seem to support HTTPS" error="failed to resolve reference \"localhost:51261/docker/library/alpine:latest\": failed to do request: Head \"http://localhost:51261/v2/docker/library/alpine/manifests/latest\": dial tcp [::1]:51261: connect: connection refused" time="2024-03-25T17:50:43Z" level=info msg="Hint: you may want to try --insecure-registry to allow plain HTTP (if you are in a trusted network)" time="2024-03-25T17:50:43Z" level=fatal msg="failed to resolve reference \"localhost:51261/docker/library/alpine:latest\": failed to do request: Head \"http://localhost:51261/v2/docker/library/alpine/manifests/latest\": dial tcp [::1]:51261: connect: connection refused" time="2024-03-25T17:50:43Z" level=fatal msg="exit status 1" ``` This error occurs here because the localImages map already has the "local" entries, even though `CleanupLocalRegistry` was run (and on top of that, the VM's disk was completely reset, including the local registry container. This is an edge case that occurs here because the `tests` package is imported once, and the global state of the `localImages` map is preserved. *Description of changes:* - Instead of using one map and overriding its entries, store the local entries in a new map so that `CleanupLocalRegistry` can reset it, and a subsequent `SetupLocalRegistry` can repopulate it without issue *Testing done:* - Tested after running Setup -> Clean -> Setup (by running the exact same failing e2e test locally), and it now works - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Justin Alvarez <[email protected]>
- Loading branch information