Giter VIP home page Giter VIP logo

Comments (9)

mattmoor avatar mattmoor commented on May 20, 2024

I think we want two constructs:

  • scratch.Image: the empty image, maybe even a singleton like authn.Anonymous (tho in hindsight, we don't get Anonymous in the godoc, so this is likely choice we should walk back before it's too late).
  • append.Image: take a base, and what to augment it with.

WDYT?

from go-containerregistry.

dlorenc avatar dlorenc commented on May 20, 2024

We need more than just append, although I guess a "SetLayers" call could be constructed out of a series of appends...

If we also had something to set the Config, I think that would be enough.

Then modifying the Config from an existing Image would look like:

Create a scratch.Image, set the Config on that.
Append in each layer from the existing Image

from go-containerregistry.

imjasonh avatar imjasonh commented on May 20, 2024

authn.Anonymous is in the godoc: https://godoc.org/github.com/google/go-containerregistry/authn -- it's just very well hidden. I'd rather file a godoc bug than modify the API to suit godoc's current behavior.

from go-containerregistry.

mattmoor avatar mattmoor commented on May 20, 2024

I retract my previous statement (I see it now), singletons are fine. :)

from go-containerregistry.

mattmoor avatar mattmoor commented on May 20, 2024

@dlorenc Why not just take a slice of layers to append? :)

from go-containerregistry.

dlorenc avatar dlorenc commented on May 20, 2024

Yeah that works, we just need a way to also set Config independently. I'm not a big fan of the way it happens in Python, with overrides being tacked onto the append.

from go-containerregistry.

imjasonh avatar imjasonh commented on May 20, 2024

What was the rationale for making v1.Image an interface instead of a struct with exported fields? That would let you modify the value returned by remote.Image(...) directly, without needing some kind of append.Image(remoteImage, newLayers...) method.

from go-containerregistry.

mattmoor avatar mattmoor commented on May 20, 2024

That necessitates eager fetching, there is signficant performance advantage to laziness.

e.g. This code should be able to copy an image between two repositories on the same registry (via mounting) without ever hitting the blob endpoint.

from go-containerregistry.

imjasonh avatar imjasonh commented on May 20, 2024

What if fields from blobs were only populated after calling some method? How large are config blobs expected to get?

from go-containerregistry.

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.