From 195e5be59af2f14661242e400b92582b26ffc467 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Sat, 18 Jul 2020 19:32:40 +0800 Subject: [PATCH] Chore: should not write file on file provider --- adapters/provider/fetcher.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/adapters/provider/fetcher.go b/adapters/provider/fetcher.go index 3cbf5fbe..c0f18c01 100644 --- a/adapters/provider/fetcher.go +++ b/adapters/provider/fetcher.go @@ -74,8 +74,10 @@ func (f *fetcher) Initial() (interface{}, error) { } } - if err := safeWrite(f.vehicle.Path(), buf); err != nil { - return nil, err + if f.vehicle.Type() != File { + if err := safeWrite(f.vehicle.Path(), buf); err != nil { + return nil, err + } } f.hash = md5.Sum(buf)