Skip to content

Commit

Permalink
Should not pass in mount option of awscredsuri
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley-wenyizha committed Aug 11, 2022
1 parent d07d3e8 commit bd0769e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit bd0769e

Please sign in to comment.