Skip to content

Commit

Permalink
draft
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hyagi committed Oct 25, 2024
1 parent c172018 commit 5cde874
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pulp_container/app/registry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
)
from pulp_container.constants import (
EMPTY_BLOB,
MANIFEST_TYPE,
SIGNATURE_API_EXTENSION_VERSION,
SIGNATURE_HEADER,
SIGNATURE_PAYLOAD_MAX_SIZE,
Expand Down Expand Up @@ -1213,6 +1214,11 @@ def put(self, request, path, pk=None):
ManifestInvalid(digest=manifest_digest)

manifest_list = self._init_manifest(manifest_digest, media_type, raw_text_data)
manifest_list.type = MANIFEST_TYPE.UNKNOWN
for manifest in found_manifests:
if manifest.type in [MANIFEST_TYPE.BOOTABLE, MANIFEST_TYPE.FLATPAK]:
manifest_list.type = manifest.type
break
manifest_list = self._save_manifest(manifest_list)

manifests_to_list = []
Expand All @@ -1235,10 +1241,13 @@ def put(self, request, path, pk=None):
)
manifest = manifest_list

# DEPRECATED: is_bootable and is_flatpak are deprecated and will be removed in a
# future release. Keeping this block for now to avoid introducing a bug or
# a regression.
# once relations for listed manifests are established, it is
# possible to initialize the nature of the manifest list
if manifest.init_manifest_list_nature():
manifest.save(update_fields=["is_bootable", "is_flatpak", "type"])
manifest.save(update_fields=["is_bootable", "is_flatpak"])

found_blobs = models.Blob.objects.filter(
digest__in=found_manifests.values_list("blobs__digest"),
Expand Down

0 comments on commit 5cde874

Please sign in to comment.