chore(deps): bump github.com/containerd/containerd from 1.7.1 to 1.7.2 (#2542)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.1 to 1.7.2. - [Release notes](https://github.com/containerd/containerd/releases) - [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md) - [Commits](https://github.com/containerd/containerd/compare/v1.7.1...v1.7.2) --- updated-dependencies: - dependency-name: github.com/containerd/containerd dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
parent
51cfcf35a0
commit
26ef57ee41
4
go.mod
4
go.mod
|
|
@ -34,7 +34,7 @@ require (
|
||||||
golang.org/x/sync v0.2.0
|
golang.org/x/sync v0.2.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require github.com/containerd/containerd v1.7.1
|
require github.com/containerd/containerd v1.7.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
|
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
|
||||||
|
|
@ -79,7 +79,7 @@ require (
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/cilium/ebpf v0.9.1 // indirect
|
github.com/cilium/ebpf v0.9.1 // indirect
|
||||||
github.com/containerd/continuity v0.3.0 // indirect
|
github.com/containerd/continuity v0.4.1 // indirect
|
||||||
github.com/containerd/fifo v1.1.0 // indirect
|
github.com/containerd/fifo v1.1.0 // indirect
|
||||||
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
|
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
|
||||||
github.com/containerd/typeurl v1.0.2 // indirect
|
github.com/containerd/typeurl v1.0.2 // indirect
|
||||||
|
|
|
||||||
7
go.sum
7
go.sum
|
|
@ -1077,8 +1077,8 @@ github.com/containerd/containerd v1.6.6/go.mod h1:ZoP1geJldzCVY3Tonoz7b1IXk8rIX0
|
||||||
github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0=
|
github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0=
|
||||||
github.com/containerd/containerd v1.6.9/go.mod h1:XVicUvkxOrftE2Q1YWUXgZwkkAxwQYNOFzYWvfVfEfQ=
|
github.com/containerd/containerd v1.6.9/go.mod h1:XVicUvkxOrftE2Q1YWUXgZwkkAxwQYNOFzYWvfVfEfQ=
|
||||||
github.com/containerd/containerd v1.6.20/go.mod h1:apei1/i5Ux2FzrK6+DM/suEsGuK/MeVOfy8tR2q7Wnw=
|
github.com/containerd/containerd v1.6.20/go.mod h1:apei1/i5Ux2FzrK6+DM/suEsGuK/MeVOfy8tR2q7Wnw=
|
||||||
github.com/containerd/containerd v1.7.1 h1:k8DbDkSOwt5rgxQ3uCI4WMKIJxIndSCBUaGm5oRn+Go=
|
github.com/containerd/containerd v1.7.2 h1:UF2gdONnxO8I6byZXDi5sXWiWvlW3D/sci7dTQimEJo=
|
||||||
github.com/containerd/containerd v1.7.1/go.mod h1:gA+nJUADRBm98QS5j5RPROnt0POQSMK+r7P7EGMC/Qc=
|
github.com/containerd/containerd v1.7.2/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
|
||||||
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||||
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||||
github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||||
|
|
@ -1087,8 +1087,9 @@ github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR
|
||||||
github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ=
|
github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ=
|
||||||
github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM=
|
github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM=
|
||||||
github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk=
|
github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk=
|
||||||
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
|
|
||||||
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
|
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
|
||||||
|
github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU=
|
||||||
|
github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
|
||||||
github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
|
github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
|
||||||
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
|
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
|
||||||
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=
|
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,14 @@ func copyIO(fifos *FIFOSet, ioset *Streams) (*cio, error) {
|
||||||
config: fifos.Config,
|
config: fifos.Config,
|
||||||
wg: wg,
|
wg: wg,
|
||||||
closers: append(pipes.closers(), fifos),
|
closers: append(pipes.closers(), fifos),
|
||||||
cancel: cancel,
|
cancel: func() {
|
||||||
|
cancel()
|
||||||
|
for _, c := range pipes.closers() {
|
||||||
|
if c != nil {
|
||||||
|
c.Close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ func WriteFile(r Driver, filename string, data []byte, perm os.FileMode) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadDir works the same as ioutil.ReadDir with the Driver abstraction
|
// ReadDir works the same as os.ReadDir with the Driver abstraction
|
||||||
func ReadDir(r Driver, dirname string) ([]os.FileInfo, error) {
|
func ReadDir(r Driver, dirname string) ([]os.FileInfo, error) {
|
||||||
f, err := r.Open(dirname)
|
f, err := r.Open(dirname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ package fs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
@ -111,7 +110,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fis, err := ioutil.ReadDir(src)
|
entries, err := os.ReadDir(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to read %s: %w", src, err)
|
return fmt.Errorf("failed to read %s: %w", src, err)
|
||||||
}
|
}
|
||||||
|
|
@ -124,18 +123,23 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
|
||||||
return fmt.Errorf("failed to copy xattrs: %w", err)
|
return fmt.Errorf("failed to copy xattrs: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, fi := range fis {
|
for _, entry := range entries {
|
||||||
source := filepath.Join(src, fi.Name())
|
source := filepath.Join(src, entry.Name())
|
||||||
target := filepath.Join(dst, fi.Name())
|
target := filepath.Join(dst, entry.Name())
|
||||||
|
|
||||||
|
fileInfo, err := entry.Info()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to get file info for %s: %w", entry.Name(), err)
|
||||||
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case fi.IsDir():
|
case entry.IsDir():
|
||||||
if err := copyDirectory(target, source, inodes, o); err != nil {
|
if err := copyDirectory(target, source, inodes, o); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
case (fi.Mode() & os.ModeType) == 0:
|
case (fileInfo.Mode() & os.ModeType) == 0:
|
||||||
link, err := getLinkSource(target, fi, inodes)
|
link, err := getLinkSource(target, fileInfo, inodes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to get hardlink: %w", err)
|
return fmt.Errorf("failed to get hardlink: %w", err)
|
||||||
}
|
}
|
||||||
|
|
@ -146,7 +150,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
|
||||||
} else if err := CopyFile(target, source); err != nil {
|
} else if err := CopyFile(target, source); err != nil {
|
||||||
return fmt.Errorf("failed to copy files: %w", err)
|
return fmt.Errorf("failed to copy files: %w", err)
|
||||||
}
|
}
|
||||||
case (fi.Mode() & os.ModeSymlink) == os.ModeSymlink:
|
case (fileInfo.Mode() & os.ModeSymlink) == os.ModeSymlink:
|
||||||
link, err := os.Readlink(source)
|
link, err := os.Readlink(source)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to read link: %s: %w", source, err)
|
return fmt.Errorf("failed to read link: %s: %w", source, err)
|
||||||
|
|
@ -154,18 +158,18 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
|
||||||
if err := os.Symlink(link, target); err != nil {
|
if err := os.Symlink(link, target); err != nil {
|
||||||
return fmt.Errorf("failed to create symlink: %s: %w", target, err)
|
return fmt.Errorf("failed to create symlink: %s: %w", target, err)
|
||||||
}
|
}
|
||||||
case (fi.Mode() & os.ModeDevice) == os.ModeDevice,
|
case (fileInfo.Mode() & os.ModeDevice) == os.ModeDevice,
|
||||||
(fi.Mode() & os.ModeNamedPipe) == os.ModeNamedPipe,
|
(fileInfo.Mode() & os.ModeNamedPipe) == os.ModeNamedPipe,
|
||||||
(fi.Mode() & os.ModeSocket) == os.ModeSocket:
|
(fileInfo.Mode() & os.ModeSocket) == os.ModeSocket:
|
||||||
if err := copyIrregular(target, fi); err != nil {
|
if err := copyIrregular(target, fileInfo); err != nil {
|
||||||
return fmt.Errorf("failed to create irregular file: %w", err)
|
return fmt.Errorf("failed to create irregular file: %w", err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
logrus.Warnf("unsupported mode: %s: %s", source, fi.Mode())
|
logrus.Warnf("unsupported mode: %s: %s", source, fileInfo.Mode())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := copyFileInfo(fi, source, target); err != nil {
|
if err := copyFileInfo(fileInfo, source, target); err != nil {
|
||||||
return fmt.Errorf("failed to copy file info: %w", err)
|
return fmt.Errorf("failed to copy file info: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,6 +184,10 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
|
||||||
// CopyFile copies the source file to the target.
|
// CopyFile copies the source file to the target.
|
||||||
// The most efficient means of copying is used for the platform.
|
// The most efficient means of copying is used for the platform.
|
||||||
func CopyFile(target, source string) error {
|
func CopyFile(target, source string) error {
|
||||||
|
return copyFile(target, source)
|
||||||
|
}
|
||||||
|
|
||||||
|
func openAndCopyFile(target, source string) error {
|
||||||
src, err := os.Open(source)
|
src, err := os.Open(source)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to open source %s: %w", source, err)
|
return fmt.Errorf("failed to open source %s: %w", source, err)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Copyright The containerd Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package fs
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
)
|
||||||
|
|
||||||
|
func copyFile(target, source string) error {
|
||||||
|
if err := unix.Clonefile(source, target, unix.CLONE_NOFOLLOW); err != nil {
|
||||||
|
if !errors.Is(err, unix.ENOTSUP) && !errors.Is(err, unix.EXDEV) {
|
||||||
|
return fmt.Errorf("clonefile failed: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return openAndCopyFile(target, source)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
//go:build !darwin
|
||||||
|
// +build !darwin
|
||||||
|
|
||||||
|
/*
|
||||||
|
Copyright The containerd Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package fs
|
||||||
|
|
||||||
|
var copyFile = openAndCopyFile
|
||||||
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/containerd/continuity/sysx"
|
"github.com/containerd/continuity/sysx"
|
||||||
|
|
@ -71,6 +72,10 @@ func copyFileContent(dst, src *os.File) error {
|
||||||
func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error {
|
func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error {
|
||||||
xattrKeys, err := sysx.LListxattr(src)
|
xattrKeys, err := sysx.LListxattr(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if os.IsPermission(err) && runtime.GOOS == "darwin" {
|
||||||
|
// On darwin, character devices do not permit listing xattrs
|
||||||
|
return nil
|
||||||
|
}
|
||||||
e := fmt.Errorf("failed to list xattrs on %s: %w", src, err)
|
e := fmt.Errorf("failed to list xattrs on %s: %w", src, err)
|
||||||
if errorHandler != nil {
|
if errorHandler != nil {
|
||||||
e = errorHandler(dst, src, "", e)
|
e = errorHandler(dst, src, "", e)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ func copyFileInfo(fi os.FileInfo, src, name string) error {
|
||||||
secInfo, err := windows.GetNamedSecurityInfo(
|
secInfo, err := windows.GetNamedSecurityInfo(
|
||||||
src, windows.SE_FILE_OBJECT,
|
src, windows.SE_FILE_OBJECT,
|
||||||
windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION)
|
windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -68,7 +67,6 @@ func copyFileInfo(fi os.FileInfo, src, name string) error {
|
||||||
name, windows.SE_FILE_OBJECT,
|
name, windows.SE_FILE_OBJECT,
|
||||||
windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION,
|
windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION,
|
||||||
sid, nil, dacl, nil); err != nil {
|
sid, nil, dacl, nil); err != nil {
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -80,12 +80,13 @@ type ChangeFunc func(ChangeKind, string, os.FileInfo, error) error
|
||||||
//
|
//
|
||||||
// The change callback is called by the order of path names and
|
// The change callback is called by the order of path names and
|
||||||
// should be appliable in that order.
|
// should be appliable in that order.
|
||||||
// Due to this apply ordering, the following is true
|
//
|
||||||
// - Removed directory trees only create a single change for the root
|
// Due to this apply ordering, the following is true
|
||||||
// directory removed. Remaining changes are implied.
|
// - Removed directory trees only create a single change for the root
|
||||||
// - A directory which is modified to become a file will not have
|
// directory removed. Remaining changes are implied.
|
||||||
// delete entries for sub-path items, their removal is implied
|
// - A directory which is modified to become a file will not have
|
||||||
// by the removal of the parent directory.
|
// delete entries for sub-path items, their removal is implied
|
||||||
|
// by the removal of the parent directory.
|
||||||
//
|
//
|
||||||
// Opaque directories will not be treated specially and each file
|
// Opaque directories will not be treated specially and each file
|
||||||
// removed from the base directory will show up as a removal.
|
// removed from the base directory will show up as a removal.
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,13 @@ package fs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func locateDummyIfEmpty(path string) (string, error) {
|
func locateDummyIfEmpty(path string) (string, error) {
|
||||||
children, err := ioutil.ReadDir(path)
|
children, err := os.ReadDir(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,11 @@ import (
|
||||||
|
|
||||||
// blocksUnitSize is the unit used by `st_blocks` in `stat` in bytes.
|
// blocksUnitSize is the unit used by `st_blocks` in `stat` in bytes.
|
||||||
// See https://man7.org/linux/man-pages/man2/stat.2.html
|
// See https://man7.org/linux/man-pages/man2/stat.2.html
|
||||||
// st_blocks
|
//
|
||||||
// This field indicates the number of blocks allocated to the
|
// st_blocks
|
||||||
// file, in 512-byte units. (This may be smaller than
|
// This field indicates the number of blocks allocated to the
|
||||||
// st_size/512 when the file has holes.)
|
// file, in 512-byte units. (This may be smaller than
|
||||||
|
// st_size/512 when the file has holes.)
|
||||||
const blocksUnitSize = 512
|
const blocksUnitSize = 512
|
||||||
|
|
||||||
type inode struct {
|
type inode struct {
|
||||||
|
|
@ -48,7 +49,6 @@ func newInode(stat *syscall.Stat_t) inode {
|
||||||
}
|
}
|
||||||
|
|
||||||
func diskUsage(ctx context.Context, roots ...string) (Usage, error) {
|
func diskUsage(ctx context.Context, roots ...string) (Usage, error) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
size int64
|
size int64
|
||||||
inodes = map[inode]struct{}{} // expensive!
|
inodes = map[inode]struct{}{} // expensive!
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func diskUsage(ctx context.Context, roots ...string) (Usage, error) {
|
func diskUsage(ctx context.Context, roots ...string) (Usage, error) {
|
||||||
var (
|
var size int64
|
||||||
size int64
|
|
||||||
)
|
|
||||||
|
|
||||||
// TODO(stevvooe): Support inodes (or equivalent) for windows.
|
// TODO(stevvooe): Support inodes (or equivalent) for windows.
|
||||||
|
|
||||||
|
|
@ -57,9 +55,7 @@ func diskUsage(ctx context.Context, roots ...string) (Usage, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func diffUsage(ctx context.Context, a, b string) (Usage, error) {
|
func diffUsage(ctx context.Context, a, b string) (Usage, error) {
|
||||||
var (
|
var size int64
|
||||||
size int64
|
|
||||||
)
|
|
||||||
|
|
||||||
if err := Changes(ctx, a, b, func(kind ChangeKind, _ string, fi os.FileInfo, err error) error {
|
if err := Changes(ctx, a, b, func(kind ChangeKind, _ string, fi os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var errTooManyLinks = errors.New("too many links")
|
||||||
errTooManyLinks = errors.New("too many links")
|
|
||||||
)
|
|
||||||
|
|
||||||
type currentPath struct {
|
type currentPath struct {
|
||||||
path string
|
path string
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ github.com/containerd/cgroups
|
||||||
github.com/containerd/cgroups/stats/v1
|
github.com/containerd/cgroups/stats/v1
|
||||||
github.com/containerd/cgroups/v2
|
github.com/containerd/cgroups/v2
|
||||||
github.com/containerd/cgroups/v2/stats
|
github.com/containerd/cgroups/v2/stats
|
||||||
# github.com/containerd/containerd v1.7.1
|
# github.com/containerd/containerd v1.7.2
|
||||||
## explicit; go 1.19
|
## explicit; go 1.19
|
||||||
github.com/containerd/containerd/cio
|
github.com/containerd/containerd/cio
|
||||||
github.com/containerd/containerd/defaults
|
github.com/containerd/containerd/defaults
|
||||||
|
|
@ -276,8 +276,8 @@ github.com/containerd/containerd/pkg/cap
|
||||||
github.com/containerd/containerd/pkg/seccomp
|
github.com/containerd/containerd/pkg/seccomp
|
||||||
github.com/containerd/containerd/pkg/userns
|
github.com/containerd/containerd/pkg/userns
|
||||||
github.com/containerd/containerd/platforms
|
github.com/containerd/containerd/platforms
|
||||||
# github.com/containerd/continuity v0.3.0
|
# github.com/containerd/continuity v0.4.1
|
||||||
## explicit; go 1.17
|
## explicit; go 1.19
|
||||||
github.com/containerd/continuity/devices
|
github.com/containerd/continuity/devices
|
||||||
github.com/containerd/continuity/driver
|
github.com/containerd/continuity/driver
|
||||||
github.com/containerd/continuity/fs
|
github.com/containerd/continuity/fs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue