Skip to content

Commit

Permalink
fix: close tmp file before rename
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph MEIER <meier-christoph@users.noreply.github.com>
  • Loading branch information
meier-christoph committed Feb 9, 2024
1 parent 6329f9f commit 8f9c9c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/vendir/fetch/http/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (t *Sync) Sync(dstPath string, tempArea ctlfetch.TempArea) (ctlconf.LockDir

incomingTmpPath := filepath.Dir(tmpFile.Name())
archivePath := filepath.Join(incomingTmpPath, path.Base(t.opts.URL))
tmpFile.Close()
err = os.Rename(tmpFile.Name(), archivePath)
if err != nil {
return lockConf, err
Expand Down

0 comments on commit 8f9c9c2

Please sign in to comment.