Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 10, 2024
1 parent 8431910 commit 338664d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class CondaStoreServer(Application):
)

enable_registry = Bool(
False, help="(deprecated) enable the docker registry for conda-store", config=True
False,
help="(deprecated) enable the docker registry for conda-store",
config=True,
)

enable_metrics = Bool(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def replace_words(s, words):

def get_docker_image_manifest(conda_store, image, tag, timeout=10 * 60):
namespace, *image_name = image.split("/")
response_headers = {"Deprecation": "True", "Sunset": "Mon, 16 Feb 2025 23:59:59 UTC"}
response_headers = {
"Deprecation": "True",
"Sunset": "Mon, 16 Feb 2025 23:59:59 UTC",
}

# /v2/<image-name>/manifest/<tag>
if len(image_name) == 0:
Expand All @@ -106,7 +109,10 @@ def get_docker_image_manifest(conda_store, image, tag, timeout=10 * 60):
elif tag.startswith("sha256:"):
# looking for sha256 of docker manifest
manifests_key = f"docker/manifest/{tag}"
return RedirectResponse(conda_store.storage.get_url(manifests_key), response_headers=response_headers)
return RedirectResponse(
conda_store.storage.get_url(manifests_key),
response_headers=response_headers,
)
else:
build_key = tag

Expand All @@ -127,13 +133,20 @@ def get_docker_image_manifest(conda_store, image, tag, timeout=10 * 60):
return docker_error_message(schema.DockerRegistryError.MANIFEST_UNKNOWN)

manifests_key = f"docker/manifest/{build_key}"
return RedirectResponse(conda_store.storage.get_url(manifests_key), response_headers=response_headers)
return RedirectResponse(
conda_store.storage.get_url(manifests_key), response_headers=response_headers
)


def get_docker_image_blob(conda_store, image, blobsum):
blob_key = f"docker/blobs/{blobsum}"
response_headers = {"Deprecation": "True", "Sunset": "Mon, 16 Feb 2025 23:59:59 UTC"}
return RedirectResponse(conda_store.storage.get_url(blob_key), response_headers=response_headers)
response_headers = {
"Deprecation": "True",
"Sunset": "Mon, 16 Feb 2025 23:59:59 UTC",
}
return RedirectResponse(
conda_store.storage.get_url(blob_key), response_headers=response_headers
)


@router_registry.get("/v2/", deprecated=True)
Expand All @@ -147,9 +160,7 @@ def v2(
return _json_response({})


@router_registry.get(
"/v2/{rest:path}", deprecated=True
)
@router_registry.get("/v2/{rest:path}", deprecated=True)
def list_tags(
rest: str,
request: Request,
Expand Down

0 comments on commit 338664d

Please sign in to comment.