Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docker_registry_util/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ def __init__(self, client):
def client(self):
return self._client

def refresh(self):
def refresh(self, repos=None):
log.info("Initializing cache.")
if self._initialized:
log.info("Clearing.")
self._cache.reset()
repos = self._client.get_catalog().json()['repositories']
repos = self._client.get_catalog().json()['repositories'] if not repos else _str_or_list(repos)
log.info("Found %s repositories.", len(repos))
for repo in repos:
log.info("Checking repository '%s'.", repo)
Expand Down Expand Up @@ -252,7 +252,7 @@ def _complete_match(d):
return True

if not self._initialized:
self.refresh()
self.refresh(repos)
included_filter = _generate_tag_funcs(tags)
excluded_filter = _generate_tag_funcs(exclude_tags)
tag_sets = dict()
Expand Down Expand Up @@ -296,7 +296,7 @@ def get_tag_names(self, repos=None, reverse_sort=False):
:rtype: list[(str, str)]
"""
if not self._initialized:
self.refresh()
self.refresh(repos)
if repos:
repo_list = _str_or_list(repos)
else:
Expand Down