Skip to content

Commit

Permalink
Download config blob regardless of the remote's settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ipanova committed Mar 30, 2021
1 parent 6b674f7 commit 00c0459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES/8319.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Config blob is downloaded always, regardless of the remote's settings.
8 changes: 5 additions & 3 deletions pulp_container/app/tasks/sync_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def handle_blobs(self, man, content_data, total_blobs):
total_blobs.append(blob_dc)
layer = content_data.get("config", None)
if layer:
blob_dc = self.create_blob(man, layer)
blob_dc = self.create_blob(man, layer, deferred_download=False)
blob_dc.extra_data["config_relation"] = man
total_blobs.append(blob_dc)

Expand Down Expand Up @@ -309,13 +309,15 @@ def create_manifest(self, list_dc, manifest_data):
)
return man_dc

def create_blob(self, man_dc, blob_data):
def create_blob(self, man_dc, blob_data, deferred_download=True):
"""
Create blob.
Args:
man_dc (pulpcore.plugin.stages.DeclarativeContent): dc for a ImageManifest
blob_data (dict): Data about a blob
deferred_download (bool): boolean that indicates whether not to download a blob
immediatly. Config blob is downloaded regardless of the remote's settings
"""
digest = blob_data.get("digest") or blob_data.get("blobSum")
Expand All @@ -330,7 +332,7 @@ def create_blob(self, man_dc, blob_data):
url=blob_url,
relative_path=digest,
remote=self.remote,
deferred_download=self.deferred_download,
deferred_download=deferred_download and self.deferred_download,
)
blob_dc = DeclarativeContent(content=blob, d_artifacts=[da])

Expand Down

0 comments on commit 00c0459

Please sign in to comment.