From bd0769e6e88e035585631c24ae78d5413272806c Mon Sep 17 00:00:00 2001 From: Ashley Zhao Date: Thu, 11 Aug 2022 12:02:39 -0400 Subject: [PATCH] Should not pass in mount option of awscredsuri --- pkg/driver/node.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/driver/node.go b/pkg/driver/node.go index f9e629cbe..181c7ba51 100644 --- a/pkg/driver/node.go +++ b/pkg/driver/node.go @@ -78,7 +78,7 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu switch strings.ToLower(k) { //Deprecated case "path": - klog.Warning("Use of path under volumeAttributes is depracated. This field will be removed in future release") + klog.Warning("Use of path under volumeAttributes is deprecated. This field will be removed in future release") if !filepath.IsAbs(v) { return nil, status.Errorf(codes.InvalidArgument, "Volume context property %q must be an absolute path", k) } @@ -165,6 +165,12 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu } } + if f == "awscredsuri" { + klog.Warning("awscredsuri is not accepted as a efs-csi-driver mount option") + return nil, status.Errorf(codes.InvalidArgument, + "Should not pass in awscredsuri as a mount option") + } + if !hasOption(mountOptions, f) { mountOptions = append(mountOptions, f) }