From e9c1d8359a7e4410224d947b4c0a0e33c3de8408 Mon Sep 17 00:00:00 2001 From: SHASHIKANTH MADDINENI Date: Thu, 31 Aug 2023 23:48:51 -0400 Subject: [PATCH] Increased the AccessPoint MAX limit from 120 to 1000 --- pkg/driver/controller_test.go | 13 ++++++------- pkg/driver/gid_allocator.go | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/driver/controller_test.go b/pkg/driver/controller_test.go index 9cd7f8af8..1823e447c 100644 --- a/pkg/driver/controller_test.go +++ b/pkg/driver/controller_test.go @@ -418,7 +418,7 @@ func TestCreateVolume(t *testing.T) { DirectoryPerms: "777", BasePath: "test", GidMin: "1000", - GidMax: "1200", + GidMax: "2000", }, } @@ -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.") @@ -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). @@ -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.") diff --git a/pkg/driver/gid_allocator.go b/pkg/driver/gid_allocator.go index f7d5063e7..b56bde5f7 100644 --- a/pkg/driver/gid_allocator.go +++ b/pkg/driver/gid_allocator.go @@ -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