chunked: do not write cache file to RO store

if the layer is R/O, do not write a cache file.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2024-07-16 14:41:36 +02:00
parent a9357dd79e
commit 05334bc4cf
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772
1 changed files with 7 additions and 0 deletions

View File

@ -287,6 +287,13 @@ func (c *layersCache) load() error {
newLayers = append(newLayers, l)
continue
}
if r.ReadOnly {
// if the layer is coming from a read-only store, do not attempt
// to write to it.
continue
}
// the cache file is either not present or broken. Try to generate it from the TOC.
l, err = c.createCacheFileFromTOC(r.ID)
if err != nil {