Skip to content

Commit

Permalink
draft/wip
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hyagi committed Apr 1, 2024
1 parent 355315f commit 399dbd3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pulp_container/app/registry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ def _init_manifest(self, manifest_digest, media_type, config_blob=None):
digest=manifest_digest,
schema_version=2,
media_type=media_type,
config_blob=config_blob,
config=config_blob,
)

def _save_manifest(self, manifest, artifact):
Expand Down
2 changes: 1 addition & 1 deletion pulp_container/app/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ManifestSerializer(SingleArtifactContentSerializer):
many=False,
required=False,
help_text="Blob that contains configuration for this Manifest",
view_name="container-config-blobs-detail",
view_name="container-blobs-detail",
queryset=models.Blob.objects.all(),
)
config = DetailRelatedField(
Expand Down
4 changes: 2 additions & 2 deletions pulp_container/app/tasks/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_or_create_blob(layer_json, manifest, path):
layer_file_name = os.path.join(path, layer_json["digest"][7:])
blob = Blob(digest=layer_json["digest"])
blob.save()
if layer_json["mediaType"] == MEDIA_TYPE.CONFIG_BLOB_OCI: #### PENDING ADD CONFIG_BLOB
if layer_json["mediaType"] in [MEDIA_TYPE.CONFIG_BLOB_OCI, MEDIA_TYPE.CONFIG_BLOB]:
with open(layer_file_name, "r") as content_file:
raw_data = content_file.read()
content_data = json.loads(raw_data)
Expand Down Expand Up @@ -101,7 +101,7 @@ def add_image_from_directory_to_repository(path, repository, tag):
manifest_artifact.file.close()

config_blob = get_or_create_blob(manifest_json["config"], manifest, path)
manifest.config_blob = config_blob
manifest.config = config_blob
manifest.save()

pks_to_add = []
Expand Down
2 changes: 1 addition & 1 deletion pulp_container/app/tasks/sync_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ async def resolve_flush(self):
for manifest_dc in self.manifest_dcs:
config_blob_dc = manifest_dc.extra_data.get("config_blob_dc")
if config_blob_dc:
manifest_dc.content.config_blob = await config_blob_dc.resolution()
manifest_dc.content.config = await config_blob_dc.resolution()
await sync_to_async(manifest_dc.content.init_labels)()
manifest_dc.content.init_image_nature()
for blob_dc in manifest_dc.extra_data["blob_dcs"]:
Expand Down

0 comments on commit 399dbd3

Please sign in to comment.