fix(cas): return 404 error if artifact does not exist - #227
Merged
Conversation
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
migmartri
commented
Jul 10, 2023
| res, err := backend.Describe(ctx, req.Digest) | ||
| if err != nil { | ||
| res, err := b.Describe(ctx, req.Digest) | ||
| if err != nil && backend.IsNotFound(err) { |
Member
Author
There was a problem hiding this comment.
we now check if the error is not found
migmartri
commented
Jul 10, 2023
| img, err := remote.Image(ref, remote.WithAuthFromKeychain(b.keychain)) | ||
| if err != nil { | ||
| var e *transport.Error | ||
| if errors.As(err, &e) && e.StatusCode == http.StatusNotFound { |
Member
Author
There was a problem hiding this comment.
this is the way we bubble up the not found error
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handles the fact that an image doesn't exist in the CAS instead of returning a generic error and notifying the exception manager.
This patch also includes some makefile refactoring to check that some of the new tools required are in place.