|
|
|
@ -19,6 +19,7 @@ class ContainerRegistryService: |
|
|
|
|
api_username = cfg.get('registry_username') |
|
|
|
|
api_password = cfg.get('registry_password') |
|
|
|
|
self.basic_auth = HTTPBasicAuth(api_username, api_password) |
|
|
|
|
self.projects_to_ignore = cfg.get('registry_projects_to_ignore') |
|
|
|
|
|
|
|
|
|
def _http_request(self, method: str, path: str, **kwargs): |
|
|
|
|
return requests.request( |
|
|
|
@ -45,12 +46,9 @@ class ContainerRegistryService: |
|
|
|
|
# we're actually just going to get a list of projects |
|
|
|
|
resp = self._http_get('/projects') |
|
|
|
|
resp.raise_for_status() |
|
|
|
|
# This project is only owned by the admin account, so we don't |
|
|
|
|
# want to include it |
|
|
|
|
project_exceptions = ['library'] |
|
|
|
|
return [ |
|
|
|
|
project['name'] for project in resp.json() |
|
|
|
|
if project['name'] not in project_exceptions |
|
|
|
|
if project['name'] not in self.projects_to_ignore |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
def create_project_for_user(self, username: str): |
|
|
|
|