fix(ansible): the swarm prune reads every image from Docker's API, untagged ones included (#6399)
`docker image ls` on Docker 29 leaves out images with no tag, which is every image a swarm task pulled by digest: the check run on VDNT-Docker03 saw 4 of its 58. Missing them only kept them, but superseded digests there would never have gone. The list now comes from GET /images/json on the socket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,6 +72,7 @@ def _fake_docker(monkeypatch, prune, answers, removed):
|
||||
raise answer
|
||||
return answer
|
||||
monkeypatch.setattr(prune, "docker", docker)
|
||||
monkeypatch.setattr(prune, "api", lambda path: answers[path])
|
||||
|
||||
|
||||
def _answers():
|
||||
@@ -82,8 +83,7 @@ def _answers():
|
||||
{"Spec": {"TaskTemplate": {"ContainerSpec": {"Image": "proxy:3@sha256:ppp"}}}}]),
|
||||
"ps -aq": "c1\n",
|
||||
"container inspect": json.dumps([{"Image": "sha256:9", "Config": {"Image": "local:1"}}]),
|
||||
"image ls": "sha256:1\nsha256:2\nsha256:3\nsha256:9\n",
|
||||
"image inspect": json.dumps([
|
||||
"/images/json": ([
|
||||
_image("sha256:1", ["registry.example/app:dev"], ["registry.example/app@sha256:aaa"]),
|
||||
_image("sha256:2", ["proxy:3"], ["proxy@sha256:ppp"]),
|
||||
_image("sha256:3", ["registry.example/app:old"], ["registry.example/app@sha256:old"], size=500),
|
||||
|
||||
Reference in New Issue
Block a user