Skip to content

Commit

Permalink
Add sunset info to api deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Dec 16, 2024
1 parent 8c85a44 commit d0c94c7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1353,14 +1353,14 @@ async def api_get_build_archive(


@router_api.get("/build/{build_id}/docker/", deprecated=True)
@deprecated(sunset_date="Mon, 16 Feb 2025 23:59:59 UTC")
async def api_get_build_docker_image_url(
build_id: int,
request: Request,
conda_store=Depends(dependencies.get_conda_store),
server=Depends(dependencies.get_server),
auth=Depends(dependencies.get_auth),
):
response_headers = {"Deprecation": "True"}
with conda_store.get_db() as db:
build = api.get_build(db, build_id)
auth.authorize_request(
Expand All @@ -1372,15 +1372,15 @@ async def api_get_build_docker_image_url(

if build.has_docker_manifest:
url = f"{server.registry_external_url}/{build.environment.namespace.name}/{build.environment.name}:{build.build_key}"
return PlainTextResponse(url, headers=response_headers)
return PlainTextResponse(url)

else:
content = {
"status": "error",
"message": f"Build {build_id} doesn't have a docker manifest",
}
return JSONResponse(
status_code=400, content=content, headers=response_headers
status_code=400, content=content,
)


Expand Down

0 comments on commit d0c94c7

Please sign in to comment.