Skip to content

Commit 69c319f

Browse files
committed
Strip "library" prefix from official registry
Fixes #71
1 parent 9bb4d8c commit 69c319f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

db-auto-backup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ def get_container_names(container: Container) -> Iterable[str]:
169169
names = set()
170170
for tag in container.image.tags:
171171
registry, image = docker.auth.resolve_repository_name(tag)
172+
173+
# HACK: Strip "library" from official images
174+
if registry == docker.auth.INDEX_NAME:
175+
image = image.removeprefix("library/")
176+
172177
image, tag_name = image.split(":", 1)
173178
names.add(image)
174179
return names

tests/tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def test_uptime_kuma_success_hook_url(monkeypatch: Any) -> None:
101101
("ghcr.io/realorangeone/db-auto-backup:latest", "realorangeone/db-auto-backup"),
102102
("theorangeone/db-auto-backup:latest:latest", "theorangeone/db-auto-backup"),
103103
("lscr.io/linuxserver/mariadb:latest", "linuxserver/mariadb"),
104+
("docker.io/library/postgres:14-alpine", "postgres"),
105+
("library/postgres:14-alpine", "postgres"),
104106
],
105107
)
106108
def test_get_container_names(tag: str, name: str) -> None:

0 commit comments

Comments
 (0)