Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

returns min possible size vol #290

Merged
merged 3 commits into from
May 29, 2024
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/dell/gocsi v1.10.0
github.com/dell/gofsutil v1.15.0
github.com/dell/goiscsi v1.9.0
github.com/dell/gopowermax/v2 v2.6.0
github.com/dell/gopowermax/v2 v2.6.1-0.20240516124821-9e04461f733f
github.com/fsnotify/fsnotify v1.4.9
github.com/kubernetes-csi/csi-lib-utils v0.7.0
github.com/sirupsen/logrus v1.9.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ github.com/dell/gonvme v1.7.0 h1:ztJFhKQehZjfaoNv+hTbGbdhLWCAhPE44k1v7x5o2c0=
github.com/dell/gonvme v1.7.0/go.mod h1:ajbuF+fswq+ty2tRTG5FN4ecIMJsG7aDu/bkMynTKAs=
github.com/dell/gopowermax/v2 v2.6.0 h1:MyenUGEt1EkGoBRwC1nYAC43yBd9LsowIIqiHOMqq5o=
github.com/dell/gopowermax/v2 v2.6.0/go.mod h1:Z/DqRsmKztpvgkWnMzm/aHBvdbnoTfpzYhpsSQnLX7k=
github.com/dell/gopowermax/v2 v2.6.1-0.20240516124821-9e04461f733f h1:D6JeGs2Ru2bX8sQ2sQMbLvLl1DuCBus0xLvcCLGSaMw=
github.com/dell/gopowermax/v2 v2.6.1-0.20240516124821-9e04461f733f/go.mod h1:Z/DqRsmKztpvgkWnMzm/aHBvdbnoTfpzYhpsSQnLX7k=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
Expand Down
6 changes: 3 additions & 3 deletions service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1501,9 +1501,9 @@ func (s *service) validateVolSize(ctx context.Context, cr *csi.CapacityRange, sy
"bad capacity: requested minimum size (%d bytes) is greater than the maximum available capacity (%d bytes)", minSizeBytes, maxAvailBytes)
}
if minSizeBytes < MinVolumeSizeBytes {
return 0, status.Errorf(
codes.OutOfRange,
"bad capacity: requested minimum size (%d bytes) is less than the minimum volume size (%d bytes)", minSizeBytes, MinVolumeSizeBytes)
log.Warningf("bad capacity: requested size (%d bytes) is less than the minimum volume size (%d bytes) supported by PowerMax..", minSizeBytes, MinVolumeSizeBytes)
log.Warning("Proceeding with minimum volume size supported by PowerMax Array ......")
minSizeBytes = MinVolumeSizeBytes
}
if maxSizeBytes < minSizeBytes {
return 0, status.Errorf(
Expand Down
6 changes: 3 additions & 3 deletions service/features/service.feature
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,14 @@ Feature: PowerMax CSI interface
Examples:
| induced | nCYL | errormsg |
| "none" | 0 | "Invalid argument" |
| "none" | 2 | "bad capacity" |
| "none" | 2 | "Attempting to shrink the volume size" |
| "none" | 29 | "Attempting to shrink the volume size" |
| "none" | 30 | "none" |
| "none" | 24 | "bad capacity" |
| "none" | 24 | "Attempting to shrink the volume size" |
| "none" | 35791396 | "bad capacity" |
| "none" | 35791395 | "none" |
| "none" | 32 | "none" |
| "NoVolumeID" | 2 | "Invalid volume id" |
| "NoVolumeID" | 2 | "Invalid volume id" |
| "ExpandVolumeError" | 32 | "induced error" |


Expand Down
2 changes: 1 addition & 1 deletion service/service_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestGetVolSize(t *testing.T) {
RequiredBytes: MinVolumeSizeBytes - 1,
LimitBytes: 0,
},
numOfCylinders: 0,
numOfCylinders: 26,
},
{
// requesting a negative required bytes
Expand Down
Loading