@@ -200,10 +200,6 @@ async def get_tag(self, request):
200
200
"Content-Type" : return_media_type ,
201
201
"Docker-Content-Digest" : tag .tagged_manifest .digest ,
202
202
}
203
- # TODO: BACKWARD COMPATIBILITY - remove after fully migrating to artifactless manifest
204
- if not tag .tagged_manifest .data :
205
- return await self .dispatch_tag (request , tag , response_headers )
206
- # END OF BACKWARD COMPATIBILITY
207
203
return web .Response (text = tag .tagged_manifest .data , headers = response_headers )
208
204
209
205
# return what was found in case media_type is accepted header (docker, oci)
@@ -213,41 +209,11 @@ async def get_tag(self, request):
213
209
"Content-Type" : return_media_type ,
214
210
"Docker-Content-Digest" : tag .tagged_manifest .digest ,
215
211
}
216
- # TODO: BACKWARD COMPATIBILITY - remove after fully migrating to artifactless manifest
217
- if not tag .tagged_manifest .data :
218
- return await self .dispatch_tag (request , tag , response_headers )
219
- # END OF BACKWARD COMPATIBILITY
220
212
return web .Response (text = tag .tagged_manifest .data , headers = response_headers )
221
213
222
214
# return 404 in case the client is requesting docker manifest v2 schema 1
223
215
raise PathNotResolved (tag_name )
224
216
225
- # TODO: BACKWARD COMPATIBILITY - remove after fully migrating to artifactless manifest
226
- async def dispatch_tag (self , request , tag , response_headers ):
227
- """
228
- Finds an artifact associated with a Tag and sends it to the client, otherwise tries
229
- to stream it.
230
-
231
- Args:
232
- request(:class:`~aiohttp.web.Request`): The request to prepare a response for.
233
- tag: Tag
234
- response_headers (dict): dictionary that contains the 'Content-Type' header to send
235
- with the response
236
-
237
- Returns:
238
- :class:`aiohttp.web.StreamResponse` or :class:`aiohttp.web.FileResponse`: The response
239
- streamed back to the client.
240
-
241
- """
242
- try :
243
- artifact = await tag .tagged_manifest ._artifacts .aget ()
244
- except ObjectDoesNotExist :
245
- ca = await sync_to_async (lambda x : x [0 ])(tag .tagged_manifest .contentartifact_set .all ())
246
- return await self ._stream_content_artifact (request , web .StreamResponse (), ca )
247
- else :
248
- return await Registry ._dispatch (artifact , response_headers )
249
- # END OF BACKWARD COMPATIBILITY
250
-
251
217
@RegistryContentCache (
252
218
base_key = lambda req , cac : Registry .find_base_path_cached (req , cac ),
253
219
auth = lambda req , cac , bk : Registry .auth_cached (req , cac , bk ),
@@ -283,16 +249,6 @@ async def get_by_digest(self, request):
283
249
"Content-Type" : manifest .media_type ,
284
250
"Docker-Content-Digest" : manifest .digest ,
285
251
}
286
- # TODO: BACKWARD COMPATIBILITY - remove after migrating to artifactless manifest
287
- if not manifest .data :
288
- if saved_artifact := await manifest ._artifacts .afirst ():
289
- return await Registry ._dispatch (saved_artifact , headers )
290
- else :
291
- ca = await sync_to_async (lambda x : x [0 ])(manifest .contentartifact_set .all ())
292
- return await self ._stream_content_artifact (
293
- request , web .StreamResponse (), ca
294
- )
295
- # END OF BACKWARD COMPATIBILITY
296
252
return web .Response (text = manifest .data , headers = headers )
297
253
elif content_type == "blobs" :
298
254
ca = await ContentArtifact .objects .select_related ("artifact" , "content" ).aget (
0 commit comments