Giter Site home page Giter Site logo

Comments (3)

chanseokoh avatar chanseokoh commented on May 18, 2024

I'm starting to question if the proposed do-HEAD-then-GET is needed for practical purposes (although I haven't looked into the Docker registry protocol.) If HEAD does not return 2xx for the given digest, it can never mean the registry has the blob in question. I think the only gain with the second GET is that we can verify if the server is really saying the given digest is absent or the server is not well-behaving. But even when the server is not well-behaving, we are checking the code 404, so we will halt and surface other non-404 and 2xx responses immediately. Not to mention 404 seems enough to over-approximate the absence of the blob. Even if 404 was due to a server malfunctioning, the subsequent pushBlob() will surface a problem.

from jib.

chanseokoh avatar chanseokoh commented on May 18, 2024

However, this might matter if we are going to have a complete registry client library. I don't know.

from jib.

chanseokoh avatar chanseokoh commented on May 18, 2024

As I said earlier, I think we are fine to not implement the proposed do-HEAD-then-GET in practice.

However, we have some code around this including a TODO, so we need to clean them up.

if (responseException.getContent() == null) {
// TODO: The Google HTTP client gives null content for HEAD requests. Make the content never
// be null, even for HEAD requests.
return Optional.empty();
}
// Find a BLOB_UNKNOWN error response code.
ErrorCodes errorCode = ErrorResponseUtil.getErrorCode(responseException);
if (errorCode == ErrorCodes.BLOB_UNKNOWN) {
return Optional.empty();
}
// BLOB_UNKNOWN was not found as a error response code.
throw responseException;

from jib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.