Skip to content

Commit 3f36f09

Browse files
Increased the AccessPoint MAX limit from 120 to 1000
1 parent b00bf67 commit 3f36f09

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pkg/driver/controller_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func TestCreateVolume(t *testing.T) {
418418
DirectoryPerms: "777",
419419
BasePath: "test",
420420
GidMin: "1000",
421-
GidMax: "1200",
421+
GidMax: "2000",
422422
},
423423
}
424424

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

430430
accessPoints := []*cloud.AccessPoint{}
431-
for i := 0; i < 119; i++ {
431+
for i := 0; i < ACCESS_POINT_PER_FS_LIMIT-1; i++ {
432432
gidMax, err := strconv.Atoi(req.Parameters[GidMax])
433433
if err != nil {
434434
t.Fatalf("Failed to convert GidMax Parameter to int.")
@@ -449,12 +449,12 @@ func TestCreateVolume(t *testing.T) {
449449
AccessPointId: apId,
450450
FileSystemId: fsId,
451451
PosixUser: &cloud.PosixUser{
452-
Gid: 1081,
453-
Uid: 1081,
452+
Gid: 1001,
453+
Uid: 1001,
454454
},
455455
}
456456

457-
expectedGid := 1081
457+
expectedGid := 1001
458458
mockCloud.EXPECT().DescribeFileSystem(gomock.Eq(ctx), gomock.Any()).Return(fileSystem, nil)
459459
mockCloud.EXPECT().ListAccessPoints(gomock.Eq(ctx), gomock.Any()).Return(accessPoints, nil)
460460
mockCloud.EXPECT().CreateAccessPoint(gomock.Eq(ctx), gomock.Any(), gomock.Any()).Return(lastAccessPoint, nil).
@@ -478,9 +478,8 @@ func TestCreateVolume(t *testing.T) {
478478
accessPoints = append(accessPoints, lastAccessPoint)
479479
mockCloud.EXPECT().DescribeFileSystem(gomock.Eq(ctx), gomock.Any()).Return(fileSystem, nil)
480480
mockCloud.EXPECT().ListAccessPoints(gomock.Eq(ctx), gomock.Any()).Return(accessPoints, nil)
481-
mockCloud.EXPECT().CreateAccessPoint(gomock.Eq(ctx), gomock.Any(), gomock.Any()).Return(lastAccessPoint, nil).AnyTimes()
482481

483-
// All 120 GIDs are taken now, internal limit should take effect causing CreateVolume to fail.
482+
// All 1000 GIDs are taken now, internal limit should take effect causing CreateVolume to fail.
484483
_, err = driver.CreateVolume(ctx, req)
485484
if err == nil {
486485
t.Fatalf("CreateVolume should have failed.")

pkg/driver/gid_allocator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package driver
33
import (
44
"context"
55
"fmt"
6+
"sync"
7+
68
"github.com/kubernetes-sigs/aws-efs-csi-driver/pkg/cloud"
79
"golang.org/x/exp/slices"
810
"google.golang.org/grpc/codes"
911
"google.golang.org/grpc/status"
1012
"k8s.io/klog/v2"
11-
"sync"
1213
)
1314

14-
var ACCESS_POINT_PER_FS_LIMIT int = 120
15+
var ACCESS_POINT_PER_FS_LIMIT int = 1000
1516

1617
type FilesystemID struct {
1718
gidMin int

0 commit comments

Comments
 (0)