-
Notifications
You must be signed in to change notification settings - Fork 527
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
Add --fast flag to crane validate #1013
Conversation
6e1623d
to
f741fb0
Compare
f741fb0
to
5be68f0
Compare
Codecov Report
@@ Coverage Diff @@
## main #1013 +/- ##
==========================================
- Coverage 75.33% 75.22% -0.12%
==========================================
Files 107 107
Lines 5036 5053 +17
==========================================
+ Hits 3794 3801 +7
- Misses 701 706 +5
- Partials 541 546 +5
Continue to review full report at Codecov.
|
5be68f0
to
688f025
Compare
I'm not thrilled about this still, but the I almost want to implement this across the board -- something like: type Unwrapper interface {
Unwrap() interface{}
} This is kind of like go 1.13 error stuff -- maybe we'd want We could have go-containerregistry/pkg/v1/remote/mount.go Lines 31 to 35 in 6a2e261
We're doing weird stuff to get
This might be a nice interim until we can rip out the partial stuff altogether? |
pkg/v1/remote/image.go
Outdated
@@ -221,6 +221,16 @@ func (rl *remoteImageLayer) Descriptor() (*v1.Descriptor, error) { | |||
return partial.BlobDescriptor(rl, rl.digest) | |||
} | |||
|
|||
// See partial.Exists. | |||
func (rl *remoteImageLayer) Exists() (bool, error) { | |||
resp, err := rl.ri.headBlob(rl.digest) |
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.
If the method returns (bool, error)
I would expect there to be some possibility of returning false, nil
-- otherwise, the bool is just equivalent err != nil
, and doesn't provide any other information.
Could this return false, nil
if headBlob
returns a 404? (Indicating that it successfully determined that the blob doesn't exist)
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.
You caught me being lazy, look again.
Add validate.Fast option Add Exists to remote layers Add Exists to layout Add Exists to partial Simplify some of our typechecking logic with unwrap(). Stop double-wrapping layoutImage layers.
836d7bd
to
17a8dbf
Compare
Fixes #838
Add validate.Fast option
Add Exists to remote layers
Add Exists to layout
Add Exists to partial
Simplify some of our typechecking logic with unwrap().
Stop double-wrapping layoutImage layers.