-
Notifications
You must be signed in to change notification settings - Fork 91
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
refactor(digests): standardise representation of digests to digest.Digest #898
Conversation
} | ||
|
||
src := is.BlobUploadPath(repo, uuid) | ||
|
||
_, err = os.Stat(src) | ||
_, err := os.Stat(src) |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression
|
||
is.Lock(&lockLatency) | ||
defer is.Unlock(&lockLatency) | ||
|
||
_, err = os.Stat(blobPath) | ||
_, err := os.Stat(blobPath) |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression
Codecov Report
@@ Coverage Diff @@
## main #898 +/- ##
==========================================
- Coverage 89.17% 88.72% -0.45%
==========================================
Files 72 72
Lines 13774 13786 +12
==========================================
- Hits 12283 12232 -51
- Misses 1163 1211 +48
- Partials 328 343 +15
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
50abc99
to
15bbe94
Compare
…gest - Digests were represented by different ways - We needed a uniform way to represent the digests and enforce a format - also replace usage of github.com/google/go-containerregistry/pkg/v1 with github.com/opencontainers/image-spec/specs-go/v1 Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com> (cherry picked from commit 96b2f29) (cherry picked from commit 3d41b58)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Signed-off-by: Laurentiu Niculae niculae.laurentiu1@gmail.com
(cherry picked from commit 96b2f29)
(cherry picked from commit 3d41b58)
What type of PR is this?
refactoring
Which issue does this PR fix:
#869
What does this PR do / Why do we need it:
In some cases it's unclear if the digest strings are supposed to contain just the hex or also the algorithm.
API now returns full digests with the algorithm name, and the cli now removes it for easy of view purpose (in any case if we don't remove it the algorithm name uses half the characters allowed by the digest column width).
Using the go-digest.Digest struct has some additional benefits such as having validation as methods.
Also we were using 2 different structs for manifest used in some places, resulting in incompatibility between these types when we wanted to compare objects, and duplicating methods returning basically the same information in different struct types.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.