mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-20 15:46:29 +00:00
Make docker cleanup more robust for overlayfs issues (#2033)
* Make docker cleanup more robust for overlayfs issues * it's an issue * more decent handling
This commit is contained in:
parent
548737a559
commit
0e3d95cac0
@ -334,7 +334,13 @@ class DockerInterface(CoreSysAttributes):
|
|||||||
raise DockerAPIError() from err
|
raise DockerAPIError() from err
|
||||||
|
|
||||||
# Cleanup Current
|
# Cleanup Current
|
||||||
for image in self.sys_docker.images.list(name=self.image):
|
try:
|
||||||
|
images_list = self.sys_docker.images.list(name=self.image)
|
||||||
|
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||||
|
_LOGGER.waring("Corrupt docker overlayfs found: %s", err)
|
||||||
|
raise DockerAPIError() from err
|
||||||
|
|
||||||
|
for image in images_list:
|
||||||
if origin.id == image.id:
|
if origin.id == image.id:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -346,7 +352,13 @@ class DockerInterface(CoreSysAttributes):
|
|||||||
if not old_image or self.image == old_image:
|
if not old_image or self.image == old_image:
|
||||||
return
|
return
|
||||||
|
|
||||||
for image in self.sys_docker.images.list(name=old_image):
|
try:
|
||||||
|
images_list = self.sys_docker.images.list(name=old_image)
|
||||||
|
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||||
|
_LOGGER.waring("Corrupt docker overlayfs found: %s", err)
|
||||||
|
raise DockerAPIError() from err
|
||||||
|
|
||||||
|
for image in images_list:
|
||||||
with suppress(docker.errors.DockerException, requests.RequestException):
|
with suppress(docker.errors.DockerException, requests.RequestException):
|
||||||
_LOGGER.info("Cleanup images: %s", image.tags)
|
_LOGGER.info("Cleanup images: %s", image.tags)
|
||||||
self.sys_docker.images.remove(image.id, force=True)
|
self.sys_docker.images.remove(image.id, force=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user