mirror of https://github.com/containers/podman.git
Don't ignore containerfiles outside of build context
[NO NEW TESTS NEEDED] Signed-off-by: Aleksei Kosyrev <albnnc@gmail.com>
This commit is contained in:
parent
d36c90868f
commit
3fdb6ee2df
|
@ -695,15 +695,19 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) {
|
||||||
}
|
}
|
||||||
name = filepath.ToSlash(path)
|
name = filepath.ToSlash(path)
|
||||||
}
|
}
|
||||||
excluded, err := pm.Matches(name) //nolint:staticcheck
|
// If name is absolute path, then it has to be containerfile outside of build context.
|
||||||
if err != nil {
|
// If not, we should check it for being excluded via pattern matcher.
|
||||||
return fmt.Errorf("checking if %q is excluded: %w", name, err)
|
if !filepath.IsAbs(name) {
|
||||||
}
|
excluded, err := pm.Matches(name) //nolint:staticcheck
|
||||||
if excluded {
|
if err != nil {
|
||||||
// Note: filepath.SkipDir is not possible to use given .dockerignore semantics.
|
return fmt.Errorf("checking if %q is excluded: %w", name, err)
|
||||||
// An exception to exclusions may include an excluded directory, therefore we
|
}
|
||||||
// are required to visit all files. :(
|
if excluded {
|
||||||
return nil
|
// Note: filepath.SkipDir is not possible to use given .dockerignore semantics.
|
||||||
|
// An exception to exclusions may include an excluded directory, therefore we
|
||||||
|
// are required to visit all files. :(
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch {
|
switch {
|
||||||
case dentry.Type().IsRegular(): // add file item
|
case dentry.Type().IsRegular(): // add file item
|
||||||
|
|
Loading…
Reference in New Issue