diff --git a/roles/use-buildset-registry/README.rst b/roles/use-buildset-registry/README.rst index beabcb32d..bd9a8c11b 100644 --- a/roles/use-buildset-registry/README.rst +++ b/roles/use-buildset-registry/README.rst @@ -37,11 +37,16 @@ Use this role on any host which should use the buildset registry. default, the user Ansible is running as. .. zuul:rolevar:: buildset_registry_namespaces - :default: ['docker.io', 'quay.io', 'gcr.io'] + :default: [ ('docker.io', 'https://...'), ('quay.io', ...), ('gcr.io', ...)] - The namespaces that the buildset registry supports. The buildset - registry will be consulted first for images in these namespaces. - Any others will be fetched only from their upstream sources. + The namespaces that the buildset registry supports. Each entry + should be a tuple with the first elemnet being the registry host + (usually the internet domain name) and the second being the URL the + registry is hosted at. + + The buildset registry will be consulted first for images in these + namespaces. Any others will be fetched only from their upstream + sources. Add any local or third-party registries necessary here. diff --git a/roles/use-buildset-registry/defaults/main.yaml b/roles/use-buildset-registry/defaults/main.yaml index 137d00966..fb0971126 100644 --- a/roles/use-buildset-registry/defaults/main.yaml +++ b/roles/use-buildset-registry/defaults/main.yaml @@ -1,4 +1,4 @@ buildset_registry_namespaces: - - docker.io - - quay.io - - gcr.io + - ['docker.io', 'https://registry-1.docker.io'] + - ['quay.io', 'https://quay.io'] + - ['gcr.io', 'https://gcr.io'] diff --git a/roles/use-buildset-registry/library/modify_buildkitd_toml.py b/roles/use-buildset-registry/library/modify_buildkitd_toml.py index 22c416f21..77e3fe689 100644 --- a/roles/use-buildset-registry/library/modify_buildkitd_toml.py +++ b/roles/use-buildset-registry/library/modify_buildkitd_toml.py @@ -50,7 +50,7 @@ def ansible_main(): if 'registry' not in data: data['registry'] = {} - for namespace in set(p['namespaces']): + for namespace in set([n[0] for n in p['namespaces']]): n_config = data['registry'].setdefault(namespace, {}) mirrors = n_config.setdefault('mirrors', []) new_loc = get_location(namespace, location) diff --git a/roles/use-buildset-registry/library/modify_registries_conf.py b/roles/use-buildset-registry/library/modify_registries_conf.py index 40f623e51..8f21ed7ed 100644 --- a/roles/use-buildset-registry/library/modify_registries_conf.py +++ b/roles/use-buildset-registry/library/modify_registries_conf.py @@ -48,7 +48,7 @@ def ansible_main(): input_data = None data = {} - unseen = set(p['namespaces']) + unseen = set([n[0] for n in p['namespaces']]) if 'registry' not in data: data['registry'] = [] for reg in data['registry']: