Skip to content

Commit

Permalink
Renaming var
Browse files Browse the repository at this point in the history
  • Loading branch information
adarsh-dell committed Oct 23, 2023
1 parent a86d440 commit 2cc29f7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -906,20 +906,20 @@ func (s *Service) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest)
return nil, status.Errorf(codes.Internal, "can't find array with provided id %s", arrayID)
}
}
resp, err := arr.Client.GetCapacity(ctx)
capacity, err := arr.Client.GetCapacity(ctx)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
valueInCache := getMaximumVolumeSize(ctx, arr)
if valueInCache < 0 {
maxVolSize := getMaximumVolumeSize(ctx, arr)
if maxVolSize < 0 {
return &csi.GetCapacityResponse{
AvailableCapacity: resp,
AvailableCapacity: capacity,
}, nil
}
value := wrapperspb.Int64(valueInCache)
maxVol := wrapperspb.Int64(maxVolSize)
return &csi.GetCapacityResponse{
AvailableCapacity: resp,
MaximumVolumeSize: value,
AvailableCapacity: capacity,
MaximumVolumeSize: maxVol,
}, nil
}

Expand Down

0 comments on commit 2cc29f7

Please sign in to comment.