Skip to content

Commit 9144687

Browse files
committed
Correct error checks
Signed-off-by: Prasad Ghangal <[email protected]>
1 parent 76620a4 commit 9144687

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/hostpath/snapshotmetadataserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (hp *hostPath) GetMetadataAllocated(req *csi.GetMetadataAllocatedRequest, s
8383
klog.V(4).Info("context deadline exceeded while getting allocated block metadata, returning")
8484
return nil
8585
}
86-
if err == io.EOF {
86+
if errors.Is(cbErr, io.EOF) {
8787
klog.V(4).Info("reached EOF while getting allocated block metadata, returning")
8888
// send allocated blocks found till EOF
8989
if err := sendGetMetadataAllocatedResponse(stream, vol.VolSize, cb); err != nil {
@@ -170,7 +170,7 @@ func (hp *hostPath) GetMetadataDelta(req *csi.GetMetadataDeltaRequest, stream cs
170170
klog.V(4).Info("context deadline exceeded while getting changed block metadata, returning")
171171
return nil
172172
}
173-
if err == io.EOF {
173+
if errors.Is(cbErr, io.EOF) {
174174
klog.V(4).Info("reached EOF while getting changed block metadata, returning")
175175
// send changed blocks found till EOF
176176
if err := sendGetMetadataDeltaResponse(stream, vol.VolSize, cb); err != nil {

0 commit comments

Comments
 (0)