summaryrefslogtreecommitdiffstats
path: root/pkg/container/docker_run.go
diff options
context:
space:
mode:
authorVitaliy Potyarkin <v.potyarkin@yadro.com>2024-12-27 15:56:23 +0100
committerVitaliy Potyarkin <v.potyarkin@yadro.com>2024-12-27 15:56:23 +0100
commit16ed4b72c7f3b515639e05604cb785c7879b49e3 (patch)
tree3681a032715cf5ce54b1bdbdae8420d74e77b36c /pkg/container/docker_run.go
parentMerge pull request 'chore(tests): add ./pkg/container tests' (#86) from earl-... (diff)
downloadforgejo-act-16ed4b72c7f3b515639e05604cb785c7879b49e3.tar.xz
forgejo-act-16ed4b72c7f3b515639e05604cb785c7879b49e3.zip
fix: Do not fail on nil error
Commit 92ddcdae098873ad6d9c05748ce5b6c7be83b811 has introduced a regression due to which copyDir() would fail after closing the archive successfully Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
Diffstat (limited to '')
-rw-r--r--pkg/container/docker_run.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/container/docker_run.go b/pkg/container/docker_run.go
index 191b424..3232c14 100644
--- a/pkg/container/docker_run.go
+++ b/pkg/container/docker_run.go
@@ -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)