diff --git a/pulp_container/app/tasks/sync_stages.py b/pulp_container/app/tasks/sync_stages.py index 61b14ab5e..d8db3d515 100644 --- a/pulp_container/app/tasks/sync_stages.py +++ b/pulp_container/app/tasks/sync_stages.py @@ -12,6 +12,7 @@ from pulpcore.plugin.stages import DeclarativeArtifact, DeclarativeContent, Stage, ContentSaver from pulp_container.constants import ( + MANIFEST_TYPE, MEDIA_TYPE, SIGNATURE_API_EXTENSION_VERSION, SIGNATURE_HEADER, @@ -287,9 +288,16 @@ async def resolve_flush(self): self.manifest_dcs.clear() for manifest_list_dc in self.manifest_list_dcs: + manifest_list_nature = MANIFEST_TYPE.UNKNOWN for listed_manifest in manifest_list_dc.extra_data["listed_manifests"]: # Just await here. They will be associated in the post_save hook. await listed_manifest["manifest_dc"].resolution() + if listed_manifest["manifest_dc"].content.type in [ + MANIFEST_TYPE.BOOTABLE, + MANIFEST_TYPE.FLATPAK, + ]: + manifest_list_nature = listed_manifest["manifest_dc"].content.type + manifest_list_dc.content.type = manifest_list_nature await self.put(manifest_list_dc) self.manifest_list_dcs.clear() @@ -644,8 +652,10 @@ def _post_save(self, batch): if manifest_list_manifests: ManifestListManifest.objects.bulk_create(manifest_list_manifests, ignore_conflicts=True) + # DEPRECATED: is_bootable/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 # after creating the relation between listed manifests and manifest lists, # it is possible to initialize the nature of the corresponding manifest lists for ml in manifest_lists: if ml.init_manifest_list_nature(): - ml.save(update_fields=["is_bootable", "is_flatpak", "type"]) + ml.save(update_fields=["is_bootable", "is_flatpak"])