Skip to content

Commit b6aa263

Browse files
committed
ensure registry proxy uses api_url
1 parent 220b215 commit b6aa263

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

services/director/src/simcore_service_director/registry_proxy.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async def _basic_auth_registry_request(
6868
else None
6969
)
7070

71-
request_url = URL(app_settings.DIRECTOR_REGISTRY.REGISTRY_URL).with_path(
71+
request_url = URL(app_settings.DIRECTOR_REGISTRY.api_url).with_path(
7272
path, encoded=True
7373
)
7474

@@ -218,7 +218,7 @@ async def registry_request(
218218

219219

220220
async def _is_registry_responsive(app: FastAPI) -> None:
221-
await _basic_auth_registry_request(app, path="/v2/", method="GET", timeout=1.0)
221+
await _basic_auth_registry_request(app, path="/", method="GET", timeout=1.0)
222222

223223

224224
async def _setup_registry(app: FastAPI) -> None:
@@ -268,7 +268,7 @@ async def _list_repositories_gen(
268268
app: FastAPI, service_type: ServiceType
269269
) -> AsyncGenerator[list[str], None]:
270270
with log_context(_logger, logging.DEBUG, msg="listing repositories"):
271-
path = f"/v2/_catalog?n={get_application_settings(app).DIRECTOR_REGISTRY_CLIENT_MAX_NUMBER_OF_RETRIEVED_OBJECTS}"
271+
path = f"/_catalog?n={get_application_settings(app).DIRECTOR_REGISTRY_CLIENT_MAX_NUMBER_OF_RETRIEVED_OBJECTS}"
272272
result, headers = await registry_request(app, path=path) # initial call
273273

274274
while True:
@@ -296,7 +296,7 @@ async def list_image_tags_gen(
296296
app: FastAPI, image_key: str
297297
) -> AsyncGenerator[list[str], None]:
298298
with log_context(_logger, logging.DEBUG, msg=f"listing image tags in {image_key}"):
299-
path = f"/v2/{image_key}/tags/list?n={get_application_settings(app).DIRECTOR_REGISTRY_CLIENT_MAX_NUMBER_OF_RETRIEVED_OBJECTS}"
299+
path = f"/{image_key}/tags/list?n={get_application_settings(app).DIRECTOR_REGISTRY_CLIENT_MAX_NUMBER_OF_RETRIEVED_OBJECTS}"
300300
tags, headers = await registry_request(app, path=path) # initial call
301301
while True:
302302
if "Link" in headers:
@@ -336,7 +336,7 @@ async def get_image_digest(app: FastAPI, image: str, tag: str) -> str | None:
336336
337337
SEE https://distribution.github.io/distribution/spec/api/#digest-header
338338
"""
339-
path = f"/v2/{image}/manifests/{tag}"
339+
path = f"/{image}/manifests/{tag}"
340340
_, headers = await registry_request(app, path=path)
341341

342342
headers = headers or {}
@@ -349,7 +349,7 @@ async def get_image_labels(
349349
"""Returns image labels and the image manifest digest"""
350350

351351
_logger.debug("getting image labels of %s:%s", image, tag)
352-
path = f"/v2/{image}/manifests/{tag}"
352+
path = f"/{image}/manifests/{tag}"
353353
request_result, headers = await registry_request(app, path=path)
354354
v1_compatibility_key = json.loads(request_result["history"][0]["v1Compatibility"])
355355
container_config: dict[str, Any] = v1_compatibility_key.get(

0 commit comments

Comments
 (0)