Rich error reporting for manifest push
To provide rich error reporting during manifest pushes, the storage layers verifyManifest stage has been modified to provide the necessary granularity. Along with this comes with a partial shift to explicit error types, which represents a small move in larger refactoring of error handling. Signature methods from libtrust have been added to the various Manifest types to clean up the verification code. A primitive deletion implementation for manifests has been added. It only deletes the manifest file and doesn't attempt to add some of the richer features request, such as layer cleanup.
This commit is contained in:
parent
59c399cb25
commit
6fead90736
7 changed files with 168 additions and 53 deletions
|
@ -169,11 +169,13 @@ func TestSimpleLayerRead(t *testing.T) {
|
|||
t.Fatalf("error expected fetching unknown layer")
|
||||
}
|
||||
|
||||
if err != ErrLayerUnknown {
|
||||
t.Fatalf("unexpected error fetching non-existent layer: %v", err)
|
||||
} else {
|
||||
switch err.(type) {
|
||||
case ErrUnknownLayer:
|
||||
err = nil
|
||||
default:
|
||||
t.Fatalf("unexpected error fetching non-existent layer: %v", err)
|
||||
}
|
||||
|
||||
randomLayerDigest, err := writeTestLayer(driver, ls.pathMapper, imageName, dgst, randomLayerReader)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error writing test layer: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue