diff --git a/builder/remotecontext/archive.go b/builder/remotecontext/archive.go index fc18c5da31182888e28a0b87664bcf1695f1673a..b62d9dd0b742129f35386824f6e0d134dea94874 100644 --- a/builder/remotecontext/archive.go +++ b/builder/remotecontext/archive.go @@ -122,8 +122,5 @@ func normalize(path string, root containerfs.ContainerFS) (cleanPath, fullPath s if err != nil { return "", "", errors.Wrapf(err, "forbidden path outside the build context: %s (%s)", path, cleanPath) } - if _, err := root.Lstat(fullPath); err != nil { - return "", "", errors.WithStack(convertPathError(err, path)) - } return } diff --git a/builder/remotecontext/lazycontext.go b/builder/remotecontext/lazycontext.go index 66f36defd4f51f8f972c1a28b1886224334b9381..14848baa13f396f48bf477ff24ed172470289b36 100644 --- a/builder/remotecontext/lazycontext.go +++ b/builder/remotecontext/lazycontext.go @@ -40,14 +40,14 @@ func (c *lazySource) Hash(path string) (string, error) { return "", err } - fi, err := c.root.Lstat(fullPath) + relPath, err := Rel(c.root, fullPath) if err != nil { - return "", errors.WithStack(err) + return "", errors.WithStack(convertPathError(err, cleanPath)) } - relPath, err := Rel(c.root, fullPath) + fi, err := os.Lstat(fullPath) if err != nil { - return "", errors.WithStack(convertPathError(err, cleanPath)) + return relPath, nil } sum, ok := c.sums[relPath]