From 10ffc84126b298d9b57bdef14ff0bce4ebee0f06 Mon Sep 17 00:00:00 2001 From: Jonathan Rainer Date: Sat, 12 Aug 2023 18:42:15 +0100 Subject: [PATCH] Minor fixes --- pkg/driver/access_point_provisioner.go | 2 +- pkg/driver/controller.go | 8 +------- pkg/driver/directory_provisioner.go | 2 +- pkg/driver/fs_identifier_manager.go | 2 +- pkg/driver/provisioner.go | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pkg/driver/access_point_provisioner.go b/pkg/driver/access_point_provisioner.go index a800a521e..383fa89d4 100644 --- a/pkg/driver/access_point_provisioner.go +++ b/pkg/driver/access_point_provisioner.go @@ -8,7 +8,7 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "k8s.io/klog" + "k8s.io/klog/v2" "github.com/kubernetes-sigs/aws-efs-csi-driver/pkg/cloud" ) diff --git a/pkg/driver/controller.go b/pkg/driver/controller.go index 243d76a29..5e049d9bb 100644 --- a/pkg/driver/controller.go +++ b/pkg/driver/controller.go @@ -19,11 +19,9 @@ package driver import ( "context" "fmt" - "os" "strings" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/kubernetes-sigs/aws-efs-csi-driver/pkg/cloud" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "k8s.io/klog/v2" @@ -64,10 +62,6 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) return nil, status.Error(codes.InvalidArgument, "Volume name not provided") } - // Volume size is required to match PV to PVC by k8s. - // Volume size is not consumed by EFS for any purposes. - volSize := req.GetCapacityRange().GetRequiredBytes() - volCaps := req.GetVolumeCapabilities() if len(volCaps) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume capabilities not provided") @@ -103,7 +97,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) if err != nil { d.fsIdentityManager.ReleaseGid(volumeParams[FsId], gid) - return nil, status.Errorf(codes.Internal, "Could not provision underlying storage: %v", err) + return nil, err } return &csi.CreateVolumeResponse{ diff --git a/pkg/driver/directory_provisioner.go b/pkg/driver/directory_provisioner.go index bc598c928..29bca98a3 100644 --- a/pkg/driver/directory_provisioner.go +++ b/pkg/driver/directory_provisioner.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "k8s.io/klog" + "k8s.io/klog/v2" "github.com/kubernetes-sigs/aws-efs-csi-driver/pkg/cloud" ) diff --git a/pkg/driver/fs_identifier_manager.go b/pkg/driver/fs_identifier_manager.go index 2aae0fda5..f4ad469a3 100644 --- a/pkg/driver/fs_identifier_manager.go +++ b/pkg/driver/fs_identifier_manager.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "k8s.io/klog" + "k8s.io/klog/v2" ) type FileSystemIdentityManager struct { diff --git a/pkg/driver/provisioner.go b/pkg/driver/provisioner.go index 46e8bd11e..912ba1b24 100644 --- a/pkg/driver/provisioner.go +++ b/pkg/driver/provisioner.go @@ -6,7 +6,7 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "k8s.io/klog" + "k8s.io/klog/v2" "github.com/kubernetes-sigs/aws-efs-csi-driver/pkg/cloud" )