fix: Do not fail on nil error
Commit 92ddcdae09
has introduced a
regression due to which copyDir() would fail after closing the archive
successfully
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
This commit is contained in:
parent
050bc604f8
commit
1dc0d695a1
1 changed files with 1 additions and 1 deletions
|
@ -753,7 +753,7 @@ func (cr *containerReference) copyDir(dstPath string, srcPath string, useGitIgno
|
|||
defer func(tarFile *os.File) {
|
||||
name := tarFile.Name()
|
||||
err := tarFile.Close()
|
||||
if !errors.Is(err, os.ErrClosed) {
|
||||
if err != nil && !errors.Is(err, os.ErrClosed) {
|
||||
logger.Error(err)
|
||||
}
|
||||
err = os.Remove(name)
|
||||
|
|
Loading…
Reference in a new issue