diff options
author | Naveen <172697+naveensrinivasan@users.noreply.github.com> | 2022-04-02 16:29:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-02 16:29:37 -0500 |
commit | 6375a85055b4472846445a37464851429edfa447 (patch) | |
tree | a296f777fa928beaa40c6e9731d4df161d08d91e /pkg/bindings | |
parent | 9cacc18c951d4497b5979f96d829c86ca41f777f (diff) | |
parent | d4394ea3688ad1942b8457f6df869f7c440d49e7 (diff) | |
download | podman-6375a85055b4472846445a37464851429edfa447.tar.gz podman-6375a85055b4472846445a37464851429edfa447.tar.bz2 podman-6375a85055b4472846445a37464851429edfa447.zip |
Merge branch 'containers:main' into naveen/feat/set-perms-actions
Diffstat (limited to 'pkg/bindings')
-rw-r--r-- | pkg/bindings/images/build.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index f6739b7ca..ab562377f 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -367,20 +367,20 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO return nil, err } - // Check if Containerfile is in the context directory, if so truncate the contextdirectory off path + // Check if Containerfile is in the context directory, if so truncate the context directory off path // Do NOT add to tarfile if strings.HasPrefix(containerfile, contextDir+string(filepath.Separator)) { containerfile = strings.TrimPrefix(containerfile, contextDir+string(filepath.Separator)) dontexcludes = append(dontexcludes, "!"+containerfile) } else { - // If Containerfile does not exists assume it is in context directory, do Not add to tarfile + // If Containerfile does not exist, assume it is in context directory and do Not add to tarfile if _, err := os.Lstat(containerfile); err != nil { if !os.IsNotExist(err) { return nil, err } containerfile = c } else { - // If Containerfile does exists but is not in context directory add it to the tarfile + // If Containerfile does exist and not in the context directory, add it to the tarfile tarContent = append(tarContent, containerfile) } } @@ -586,6 +586,9 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) { return errors.Wrapf(err, "error checking if %q is excluded", name) } if excluded { + // 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 } |