-
Notifications
You must be signed in to change notification settings - Fork 27
Conversation
In other words this one should be a big red flag in code - it's never right to just ignore the algorithm. What's the most common though is a pattern like:
We could look at adding a helper for that. |
In some places we started doing `.digest().digest()` which drops the algorithm. Some basic unit tests would have caught this - I added one. We also need an "upgrade from previous" test. Trying to fix this revealed a bunch more places where we had `String` and not `Digest`. Fixing those gets us type safety and points out the problem areas. Since we're breaking API as this will be the real first 0.15 release, - Drop unnecessary ManifestLayerState wrappering - Fix the manifest digest members of various structs to be a Digest
e9cc88e
to
c0bc636
Compare
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. I definitely relied entirely too much on the compiler and tests to sanity check the original patch. Some of this is really obvious in retrospect!
use super::*; | ||
|
||
#[test] | ||
fn test_ref_for_descriptor() { |
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.
❤️
@@ -21,7 +21,7 @@ use flate2::Compression; | |||
use fn_error_context::context; | |||
use futures_util::TryFutureExt; | |||
use oci_spec::image::{ | |||
self as oci_image, Arch, Descriptor, History, ImageConfiguration, ImageManifest, | |||
self as oci_image, Arch, Descriptor, Digest, History, ImageConfiguration, ImageManifest, |
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.
We still use oci_image::Digest
in a bunch of places, not a big deal but I can do a followup PR after this merges just so we're consistent everywhere.
Obligatory acknowledgement that the bootc build test is failing because we need to do the CI dance to get both updated in-tandem. |
In some places we started doing
.digest().digest()
which drops the algorithm. Some basic unit testswould have caught this - I added one. We also need an "upgrade from previous" test.
Trying to fix this revealed a bunch more places where we had
String
and notDigest
.Fixing those gets us type safety and points out the problem areas. Since we're breaking API as this will be the real first 0.15 release,