mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 08:10:20 +00:00
cephfs: newVolumeOptions() does not need all secrets, only credentials
There is no need to pass all secrets on to newVolumeOptions(), it only needs the credentials. As the caller of newVolumeOptions() already has the credentials generated, just pass them along instead of the raw secrets. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
66046e4312
commit
9bd10d2698
@ -151,7 +151,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
|
||||
}
|
||||
defer cs.VolumeLocks.Release(requestName)
|
||||
|
||||
volOptions, err := newVolumeOptions(ctx, requestName, req, secret)
|
||||
volOptions, err := newVolumeOptions(ctx, requestName, req, cr)
|
||||
if err != nil {
|
||||
util.ErrorLog(ctx, "validation and extraction of volume options failed: %v", err)
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
|
@ -171,7 +171,7 @@ func getClusterInformation(options map[string]string) (*util.ClusterInfo, error)
|
||||
// newVolumeOptions generates a new instance of volumeOptions from the provided
|
||||
// CSI request parameters.
|
||||
func newVolumeOptions(ctx context.Context, requestName string, req *csi.CreateVolumeRequest,
|
||||
secret map[string]string) (*volumeOptions, error) {
|
||||
cr *util.Credentials) (*volumeOptions, error) {
|
||||
var (
|
||||
opts volumeOptions
|
||||
err error
|
||||
@ -210,12 +210,6 @@ func newVolumeOptions(ctx context.Context, requestName string, req *csi.CreateVo
|
||||
|
||||
opts.RequestName = requestName
|
||||
|
||||
cr, err := util.NewAdminCredentials(secret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer cr.DeleteCredentials()
|
||||
|
||||
err = opts.Connect(cr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user