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

Increased the AccessPoint MAX limit from 120 to 1000 #1119

Closed
Closed
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
13 changes: 6 additions & 7 deletions pkg/driver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func TestCreateVolume(t *testing.T) {
DirectoryPerms: "777",
BasePath: "test",
GidMin: "1000",
GidMax: "1200",
GidMax: "2000",
},
}

Expand All @@ -428,7 +428,7 @@ func TestCreateVolume(t *testing.T) {
}

accessPoints := []*cloud.AccessPoint{}
for i := 0; i < 119; i++ {
for i := 0; i < 999; i++ {
gidMax, err := strconv.Atoi(req.Parameters[GidMax])
if err != nil {
t.Fatalf("Failed to convert GidMax Parameter to int.")
Expand All @@ -449,12 +449,12 @@ func TestCreateVolume(t *testing.T) {
AccessPointId: apId,
FileSystemId: fsId,
PosixUser: &cloud.PosixUser{
Gid: 1081,
Uid: 1081,
Gid: 1001,
Uid: 1001,
},
}

expectedGid := 1081
expectedGid := 1001
mockCloud.EXPECT().DescribeFileSystem(gomock.Eq(ctx), gomock.Any()).Return(fileSystem, nil)
mockCloud.EXPECT().ListAccessPoints(gomock.Eq(ctx), gomock.Any()).Return(accessPoints, nil)
mockCloud.EXPECT().CreateAccessPoint(gomock.Eq(ctx), gomock.Any(), gomock.Any()).Return(lastAccessPoint, nil).
Expand All @@ -478,9 +478,8 @@ func TestCreateVolume(t *testing.T) {
accessPoints = append(accessPoints, lastAccessPoint)
mockCloud.EXPECT().DescribeFileSystem(gomock.Eq(ctx), gomock.Any()).Return(fileSystem, nil)
mockCloud.EXPECT().ListAccessPoints(gomock.Eq(ctx), gomock.Any()).Return(accessPoints, nil)
mockCloud.EXPECT().CreateAccessPoint(gomock.Eq(ctx), gomock.Any(), gomock.Any()).Return(lastAccessPoint, nil).AnyTimes()

// All 120 GIDs are taken now, internal limit should take effect causing CreateVolume to fail.
// All 1000 GIDs are taken now, internal limit should take effect causing CreateVolume to fail.
_, err = driver.CreateVolume(ctx, req)
if err == nil {
t.Fatalf("CreateVolume should have failed.")
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/gid_allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync"
)

var ACCESS_POINT_PER_FS_LIMIT int = 120
var ACCESS_POINT_PER_FS_LIMIT int = 1000

type FilesystemID struct {
gidMin int
Expand Down
Loading