From fb5a84212c491332504fcdd4b5f4a4b97705d2e3 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 16 Jun 2021 21:00:49 +0200 Subject: Update dependencies (#1521) --- vendor/github.com/spf13/afero/cacheOnReadFs.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'vendor/github.com/spf13/afero/cacheOnReadFs.go') diff --git a/vendor/github.com/spf13/afero/cacheOnReadFs.go b/vendor/github.com/spf13/afero/cacheOnReadFs.go index 29a26c67..71471aa2 100644 --- a/vendor/github.com/spf13/afero/cacheOnReadFs.go +++ b/vendor/github.com/spf13/afero/cacheOnReadFs.go @@ -117,6 +117,27 @@ func (u *CacheOnReadFs) Chmod(name string, mode os.FileMode) error { return u.layer.Chmod(name, mode) } +func (u *CacheOnReadFs) Chown(name string, uid, gid int) error { + st, _, err := u.cacheStatus(name) + if err != nil { + return err + } + switch st { + case cacheLocal: + case cacheHit: + err = u.base.Chown(name, uid, gid) + case cacheStale, cacheMiss: + if err := u.copyToLayer(name); err != nil { + return err + } + err = u.base.Chown(name, uid, gid) + } + if err != nil { + return err + } + return u.layer.Chown(name, uid, gid) +} + func (u *CacheOnReadFs) Stat(name string) (os.FileInfo, error) { st, fi, err := u.cacheStatus(name) if err != nil { -- cgit v1.2.3