Skip to content
Permalink
Browse files
fix(buildah): import with rename and include paths not working properly
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Sep 27, 2022
1 parent 66349fc commit 4d35fdb589f9bc3da67e886d168548a57e3b0840
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
@@ -385,17 +385,20 @@ func (runtime *BuildahBackend) applyDependenciesImports(ctx context.Context, con

copyRec, err := copyrec.New(absFrom, absTo, copyrec.Options{
MatchDir: func(path string) (copyrec.DirAction, error) {
relPath := util.GetRelativeToBaseFilepath(absFrom, path)

switch {
case pathMatcher.IsPathMatched(path):
case pathMatcher.IsPathMatched(relPath):
return copyrec.DirMatch, nil
case pathMatcher.ShouldGoThrough(path):
case pathMatcher.ShouldGoThrough(relPath):
return copyrec.DirFallThrough, nil
default:
return copyrec.DirSkip, nil
}
},
MatchFile: func(path string) (bool, error) {
return pathMatcher.IsPathMatched(path), err
relPath := util.GetRelativeToBaseFilepath(absFrom, path)
return pathMatcher.IsPathMatched(relPath), err
},
UID: uid,
GID: gid,
@@ -123,10 +123,9 @@ var _ = Describe("Complex build", Label("e2e", "build", "complex"), func() {
"stat -c %u:%g /basedir/file | diff <(echo 0:0) -",
"echo 'content' | diff /basedir/file -",

// TODO: fix buildah: rename during import not working
// "test -f /basedir-imported/file",
// "stat -c %u:%g /basedir-imported/file | diff <(echo 1060:1061) -",
// "echo 'content' | diff /basedir-imported/file -",
"test -f /basedir-imported/file",
"stat -c %u:%g /basedir-imported/file | diff <(echo 1060:1061) -",
"echo 'content' | diff /basedir-imported/file -",
)
}

@@ -214,10 +213,9 @@ var _ = Describe("Complex build", Label("e2e", "build", "complex"), func() {
"stat -c %u:%g /basedir/file | diff <(echo 0:0) -",
"echo 'content' | diff /basedir/file -",

// TODO: fix buildah: rename during import not working
// "test -f /basedir-imported/file",
// "stat -c %u:%g /basedir-imported/file | diff <(echo 1060:1061) -",
// "echo 'content' | diff /basedir-imported/file -",
"test -f /basedir-imported/file",
"stat -c %u:%g /basedir-imported/file | diff <(echo 1060:1061) -",
"echo 'content' | diff /basedir-imported/file -",
)
}
},

0 comments on commit 4d35fdb

Please sign in to comment.