Repository navigation
fix(sandbox): release old images after any replacement, never a named one by ID - #177
Merged
Merged
Conversation
… one by ID Production replaced its first offices for network and binds drift, and every container on the previous :latest carries an older network label, so removal, which ran only for image drift, would never have released those images. A replacement now removes the old image whenever it differs from the configured one. Docker deletes an image by ID even while one name still points to it, so an operator's own image left behind by an office was deleted. An image is now removed by ID only when no name points to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
為什麼要改
#175 上線後,在 prod(1.4.0-beta.0)的 log 裡發現兩個問題:
network和binds,不是image;而 33 個用:latest的 container,網路 label 全部是舊格式。原本只有原因是image時才會清理舊 image,所以這些舊 image 永遠不會被清掉。rmi時,只要那個 image 只剩一個名稱,Docker 就會直接刪除,不會拒絕。feat(sandbox): keep offices on the sandbox image of the running mikan #175 的說明和測試以為「只要還有名稱,引擎就會拒絕」,這個假設是錯的。所以使用者自己 build、只有一個 tag 的 image(例如acme/sandbox:dev),在最後一個 office 換掉之後就會被刪除。改了什麼
network、binds等原因被換掉,而且舊 image 和現在設定的不同mikan-sandbox:<舊版>)rmirmi驗證
真實 Docker 引擎 eval(
.workspace/image-cleanup/docker.eval.ts):單元測試(先寫測試,修改前會失敗):
本機 gate:全部通過,共 2,110 個測試。
另外會觸發
slack-e2e.yml,因為這個 PR 改到 daemon 建立 container 的路徑。研究文件、ADR 0023 和 sandbox README 都已經更正。