Documentation
¶
Overview ¶
Package mounts remembers which repositories hold a layer, so a push can have the destination registry mount a blob instead of taking the bytes.
remote.Write only offers a mount for layers still carrying the reference they were pulled from, which every local copy kaniko makes throws away. Keyed by digest rather than held on the layer, so a copy that keeps the bytes keeps the entry and one that rewrites them misses.
The most recent repository this process read from or wrote to wins, an older one may still hold the layer but is the staler answer. A guess never displaces one of those, remote.Write fails a push when the token request for a mount source is refused and costs it a plain retry.
Index ¶
- func Mountable(repos []name.Repository, registry string) (int, bool)
- func MountableImage(img v1.Image, registry string) v1.Image
- func PlannedDigest(cacheKey string) v1.Hash
- func RecordGuess(img v1.Image, repo name.Repository)
- func RecordImage(img v1.Image, repo name.Repository)
- func Snapshot() map[v1.Hash][]name.Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Mountable ¶
func Mountable(repos []name.Repository, registry string) (int, bool)
Mountable returns one of the repositories known to hold a layer that sits on registry. Cross-registry origins are not honoured in practice, so a source elsewhere is no source.
func PlannedDigest ¶
PlannedDigest names a layer that does not exist yet by the cache key that decides where it will end up. Cache keys are sha256 hex like a digest, and never collide with one in practice.
func RecordGuess ¶ added in v1.28.4
func RecordGuess(img v1.Image, repo name.Repository)
func RecordImage ¶
func RecordImage(img v1.Image, repo name.Repository)
Types ¶
This section is empty.