From f33182539fe3f8d756647f57f03244abb14f0d51 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Sun, 9 Nov 2025 00:13:33 +0100 Subject: [PATCH] fix: improve registry URL regex to exclude image names with tags The previous regex matched 'redis:7-alpine' because it saw ':7' as a port. New regex requires: - TLD with optional port (e.g. git.michaelschiemer.de:5000) - Hostname with numeric port only (e.g. localhost:5000) - localhost with optional port This excludes image names like 'redis:7-alpine' or 'minio/minio:latest'. --- deployment/ansible/playbooks/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/ansible/playbooks/deploy-image.yml b/deployment/ansible/playbooks/deploy-image.yml index 9755eafd..a7cdcc95 100644 --- a/deployment/ansible/playbooks/deploy-image.yml +++ b/deployment/ansible/playbooks/deploy-image.yml @@ -248,7 +248,7 @@ ansible.builtin.set_fact: registries_to_login: >- {%- set found_registries = actual_registry_urls_full.stdout | trim | split('\n') | select('match', '.+') | list -%} - {%- set filtered_registries = found_registries | select('match', '.*\.(de|com|org|net|io|dev).*|.*:[0-9]+.*|^localhost$') | list -%} + {%- set filtered_registries = found_registries | select('match', '.*\.(de|com|org|net|io|dev)(:[0-9]+)?$|^[^:]+:[0-9]+$|^localhost(:[0-9]+)?$') | list -%} {%- set default_registry = [docker_registry] -%} {%- if filtered_registries | length > 0 -%} {{ filtered_registries | unique | list }}