Skip to content

Commit

Permalink
util/system: deprecate Atime implementation for containerd/continuity/fs
Browse files Browse the repository at this point in the history
These were added in 0b5a315, because the
continuity/fs package did not provide a Windows implementation. They
were upstreamed in [continuity@3cbda8c], which is part of continuity v0.4.4,
so we can deprecate the implementation here.

[continuity@3cbda8c]: https://github.com/containerd/continuity//commit/3cbda8c24bde1ce635ff5dc3417a481a3b6b6e07

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Oct 29, 2024
1 parent fd61877 commit bacdf6a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 41 deletions.
3 changes: 1 addition & 2 deletions executor/stubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/containerd/continuity/fs"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/system"
)

func MountStubsCleaner(ctx context.Context, dir string, mounts []Mount, recursive bool) func() {
Expand Down Expand Up @@ -87,7 +86,7 @@ func MountStubsCleaner(ctx context.Context, dir string, mounts []Mount, recursiv
continue
}
mtime := dirSt.ModTime()
atime, err := system.Atime(dirSt)
atime, err := fs.Atime(dirSt)
if err != nil {
bklog.G(ctx).WithError(err).Warnf("Failed to stat atime of %q (parent of mount stub %q)", dir, p)
atime = mtime
Expand Down
13 changes: 13 additions & 0 deletions util/system/atime_deprecated.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package system

import (
iofs "io/fs"
"time"

"github.com/containerd/continuity/fs"
)

// Deprecated: use [fs.Atime] instead.
func Atime(st iofs.FileInfo) (time.Time, error) {
return fs.Atime(st)
}
21 changes: 0 additions & 21 deletions util/system/atime_unix.go

This file was deleted.

18 changes: 0 additions & 18 deletions util/system/atime_windows.go

This file was deleted.

0 comments on commit bacdf6a

Please sign in to comment.