Skip to content

refactor: OCI blob digest#306

Merged
tri-adam merged 3 commits intosylabs:mainfrom
tri-adam:refactor-blob-write
Jun 15, 2023
Merged

refactor: OCI blob digest#306
tri-adam merged 3 commits intosylabs:mainfrom
tri-adam:refactor-blob-write

Conversation

@tri-adam
Copy link
Member

@tri-adam tri-adam commented Jun 15, 2023

Make a few changes related to working with OCI blobs:

  • Remove OptOCIBlobMetadata. Calculate the digest automatically when the data is read instead.
  • Rename OCIBlobMetadata to OCIBlobDigest, and have it return a v1.Hash instead of string.
  • Add WithOCIBlobDigest, to easily locate a sif.Descriptor using via GetDescriptor.

@tri-adam tri-adam self-assigned this Jun 15, 2023
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #306 (4b7d9de) into main (1e65b8a) will increase coverage by 0.27%.
The diff coverage is 95.00%.

@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
+ Coverage   72.67%   72.94%   +0.27%     
==========================================
  Files          35       35              
  Lines        2953     2953              
==========================================
+ Hits         2146     2154       +8     
+ Misses        648      644       -4     
+ Partials      159      155       -4     
Impacted Files Coverage Δ
pkg/sif/sif.go 25.89% <ø> (-3.58%) ⬇️
pkg/sif/descriptor.go 75.41% <90.90%> (+2.57%) ⬆️
internal/app/siftool/info.go 88.95% <100.00%> (ø)
pkg/sif/descriptor_input.go 86.95% <100.00%> (+1.09%) ⬆️
pkg/sif/select.go 97.29% <100.00%> (+0.15%) ⬆️
pkg/siftool/add.go 46.47% <100.00%> (+0.19%) ⬆️

@tri-adam tri-adam force-pushed the refactor-blob-write branch 2 times, most recently from dd6f8e6 to af7c554 Compare June 15, 2023 19:53
tri-adam added 3 commits June 15, 2023 20:03
Remove OptOCIBlobMetadata, which required caller to explicitly provide
the digest of an OCI blob when creating a DescriptorInput. Calculate the
digest automatically as the DataOCIRootIndex/DataOCIBlob data is read.
Return v1.Hash type directly instead of string.
@tri-adam tri-adam force-pushed the refactor-blob-write branch from 0dfd9ca to 4b7d9de Compare June 15, 2023 20:04
@tri-adam tri-adam marked this pull request as ready for review June 15, 2023 20:15
@tri-adam tri-adam merged commit 9fe9b62 into sylabs:main Jun 15, 2023
@tri-adam tri-adam deleted the refactor-blob-write branch June 15, 2023 20:38
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.

2 participants