Giter Club home page Giter Club logo

Comments (1)

JoshVanL avatar JoshVanL commented on May 25, 2024

This is a tricky one. There is a couple things going on here.

First thing I noticed was that we are not handling paging properly in most/all our clients. I will create another issue for that.

Next, version-checker is doing a bad job of being architecture aware, leading to the issue above where it picks the wrong architecture as the latest when they both have the same timestamp. To fix this correctly, we should create a node controller. This will expose a map[string]struct{OS, Arch} which should be passed down into our searcher. The searcher can then be aware of which architecture and OS to be filtering for, when getting the latest. An override option may be appropriate here, but let's leave that for later. We should update the metrics to include the os and arch as labels.

The next thing to fix is the clients which do not expose the arch and OS of image tags available. In these cases, we will likely need to swap out the native API for our first class supported clients, in favour of using the fallback generic docker API, which does support getting this information. We will likely need to do a bit of a dance in terms of permissions, in that we get a valid access token/username/password using the native client first, then passing them on correctly to the generic docker client. We shouldn't expect any config API changes.

Lastly, we need to fix the issue of the "composite hashes". When using an image in Kubernetes which has the tag of "", or "latest", and the selected tag that docker pulls is a multi-architecture image, the reported image SHA as part of the "imageID", will be the "composite hash". This means that, the reported image hash will be the hash of the full json payload (denoted in the HTTP header as DOCKER-IMAGE-DIGEST), rather than the particular image digest. To fix this, we should include a "CompositeHash" field as part of the "ImageTag" struct which includes this value, along with the image SHA. The searcher then need to be aware of whether it should compare against the raw SHA value, or the CompositeHash value. Depending on the client, it may never report a composite hash in these cases, and should be tested. If this is the case, we can save some KB and make the CompositeHash field a *string, making the searcher fall back to SHA when nil.

from version-checker.

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.