Update 'images' to v0.113.0

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-02-03 14:26:54 +01:00 committed by Achilleas Koutsou
parent b8c2e4c45c
commit 8514c95837
646 changed files with 36206 additions and 22388 deletions

View file

@ -1,5 +1,4 @@
//go:build go1.10
// +build go1.10
package archive

View file

@ -1,5 +1,4 @@
//go:build !go1.10
// +build !go1.10
package archive

View file

@ -1,5 +1,4 @@
//go:build netbsd || freebsd || darwin
// +build netbsd freebsd darwin
package archive

View file

@ -124,8 +124,7 @@ func (overlayWhiteoutConverter) ConvertReadWithHandler(hdr *tar.Header, path str
}
// if a file was deleted and we are using overlay, we need to create a character device
if strings.HasPrefix(base, WhiteoutPrefix) {
originalBase := base[len(WhiteoutPrefix):]
if originalBase, ok := strings.CutPrefix(base, WhiteoutPrefix); ok {
originalPath := filepath.Join(dir, originalBase)
if err := handler.Mknod(originalPath, unix.S_IFCHR, 0); err != nil {

View file

@ -1,5 +1,4 @@
//go:build !linux
// +build !linux
package archive

View file

@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package archive

View file

@ -1,5 +1,4 @@
//go:build windows
// +build windows
package archive

View file

@ -5,6 +5,7 @@ import (
"bytes"
"fmt"
"io"
"maps"
"os"
"path/filepath"
"reflect"
@ -97,8 +98,7 @@ func aufsDeletedFile(root, path string, fi os.FileInfo) (string, error) {
f := filepath.Base(path)
// If there is a whiteout, then the file was removed
if strings.HasPrefix(f, WhiteoutPrefix) {
originalFile := f[len(WhiteoutPrefix):]
if originalFile, ok := strings.CutPrefix(f, WhiteoutPrefix); ok {
return filepath.Join(filepath.Dir(path), originalFile), nil
}
@ -319,9 +319,7 @@ func (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {
// otherwise any previous delete/change is considered recursive
oldChildren := make(map[string]*FileInfo)
if oldInfo != nil && info.isDir() {
for k, v := range oldInfo.children {
oldChildren[k] = v
}
maps.Copy(oldChildren, oldInfo.children)
}
for name, newChild := range info.children {

View file

@ -1,5 +1,4 @@
//go:build !linux
// +build !linux
package archive
@ -31,7 +30,7 @@ func collectFileInfoForChanges(oldDir, newDir string, oldIDMap, newIDMap *idtool
}()
// block until both routines have returned
for i := 0; i < 2; i++ {
for range 2 {
if err := <-errs; err != nil {
return nil, nil, err
}

View file

@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package archive

View file

@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package archive

View file

@ -1,5 +1,4 @@
//go:build freebsd
// +build freebsd
package archive
@ -80,9 +79,9 @@ func parseFileFlags(fflags string) (uint32, uint32, error) {
var set, clear uint32 = 0, 0
for _, fflag := range strings.Split(fflags, ",") {
isClear := false
if strings.HasPrefix(fflag, "no") {
if clean, ok := strings.CutPrefix(fflag, "no"); ok {
isClear = true
fflag = strings.TrimPrefix(fflag, "no")
fflag = clean
}
if value, ok := flagNameToValue[fflag]; ok {
if isClear {

View file

@ -1,5 +1,4 @@
//go:build !freebsd
// +build !freebsd
package archive

View file

@ -1,5 +1,4 @@
//go:build !linux
// +build !linux
package archive