gofumpt is a superset of gofmt, enabling some more code formatting
rules.
This commit is brought to you by
gofumpt -w .
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
We now use the golang error wrapping format specifier `%w` instead of the
deprecated github.com/pkg/errors package.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
It is legal to use !./PATH and !/PATH in a .containerignore or
.dockerignore file.
Currently we fail to match on these patterns, Removing the leadking
"/" and cleaning the path, fixes the problem.
Fixes: https://github.com/containers/buildah/issues/3272
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
When building the regex that matches patterns, the ending bit that
matches items below directories that match the pattern should be built
using the OS-specific path separator, which is not always '/'.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Currently, double star exclude patterns are only able to match files. They
should also match directories.
Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>
Exclude patterns ending with a single slash are invalid and lead to a regexp
wrongly matching a dollar at the end of the file path. Error out instead of
building a bad regexp.
Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>
Commit 90513cbb96 introduced a regression as specified mountpoints
must be normalized (e.g., "" -> "/") before we can deal with them.
Instead of working around the fileutils package and special casing
files, add a new `fileutils.ReadSymlinkedPath` which can work with
directories and files.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This information is needed as well if we want to match
in a way that the last match has the highest priority.
We now introduce a new method `MatchesResult` to not break the previous
API.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
We now add the information how many exclusions a match has, which is
needed for more fine-granular filepath matching.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
The `pure` indicator for a match now returns `true` if it's the only
one. This additional information will be used by consumers to decide
more fine-granular if a match can be excluded completely or not.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Had to vendor in a new version of golang.org/x/net to build
Also had to make some changes to drivers to handle
archive.Reader -> io.Reader
archive.Archive -> io.ReadCloser
Also update .gitingore to ignore emacs files, containers-storage.*
and generated man pages.
Also no longer test travis against golang 1.7, cri-o, moby have also
done this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Also updates github.com/Microsoft/hcsshim
and github.com/docker/go-connections so they work
with the newer version of logrus.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Change CLI error msg because it was too specific and didn't make sense
when there were errors not related to inaccessible files.
Removed some log.Error() calls since they're not really errors we should
log. Returning the error will be enough.
Closes: #13417
Signed-off-by: Doug Davis <dug@us.ibm.com>
This is the second of two steps to break the archive package's
dependence on utils so that archive may be moved into pkg. `Matches()`
is also a good candidate pkg in that it is small, concise, and not
specific to docker internals
Signed-off-by: Rafe Colton <rafael.colton@gmail.com>