Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/ncproxy/ncproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
// GRPC service exposed for use by a Node Network Service. Holds a mutex for
// updating global client.
type grpcService struct {
m sync.Mutex
}

var _ ncproxygrpc.NetworkConfigProxyServer = &grpcService{}
Expand Down
8 changes: 2 additions & 6 deletions computestorage/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ func SetupContainerBaseLayer(ctx context.Context, layerPath, baseVhdPath, diffVh
if err != nil {
syscall.CloseHandle(handle)
os.RemoveAll(baseVhdPath)
if os.Stat(diffVhdPath); err == nil {
os.RemoveAll(diffVhdPath)
}
os.RemoveAll(diffVhdPath)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing the Stat call, should we be checking the return value?

Copy link
Copy Markdown
Contributor Author

@dcantah dcantah Mar 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't really even see a need for the stat call. If the file doesn't exist RemoveAll will just silently succeed anyways.

}
}()

Expand Down Expand Up @@ -150,9 +148,7 @@ func SetupUtilityVMBaseLayer(ctx context.Context, uvmPath, baseVhdPath, diffVhdP
if err != nil {
syscall.CloseHandle(handle)
os.RemoveAll(baseVhdPath)
if os.Stat(diffVhdPath); err == nil {
os.RemoveAll(diffVhdPath)
}
os.RemoveAll(diffVhdPath)
}
}()

Expand Down