Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Directory Transport Destination as Thread-Safe #1685

Merged
merged 1 commit into from Oct 13, 2022

Conversation

t0rr3sp3dr0
Copy link
Contributor

Just like #1481 did for OCI Layout Destination, this patch marks Directory Transport Destination as thread-safe. The PutBlobWithOptions implementation of both transports are almost identical, differing only on the path where the blob will be stored.

- 	blobPath := d.ref.layerPath(blobDigest)
+ 	blobPath, err := d.ref.blobPath(blobDigest, d.sharedBlobDir)
+	if err != nil {
+		return types.BlobInfo{}, err
+	}
+	if err := ensureParentDirectoryExists(blobPath); err != nil {
+		return types.BlobInfo{}, err
+	}

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@mtrmac mtrmac merged commit 87afcef into containers:main Oct 13, 2022
@t0rr3sp3dr0 t0rr3sp3dr0 deleted the patch-1 branch October 20, 2022 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants