mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
cephfs: createCephUser needs admin credentials
This commit is contained in:
parent
b260bff659
commit
0cc1e06beb
@ -71,7 +71,20 @@ func handleUser(volOptions *volumeOptions, volUuid string, req *csi.NodePublishV
|
|||||||
if volOptions.ProvisionVolume {
|
if volOptions.ProvisionVolume {
|
||||||
// The volume is provisioned dynamically, create a dedicated user
|
// The volume is provisioned dynamically, create a dedicated user
|
||||||
|
|
||||||
if ent, err := createCephUser(volOptions, volUuid, req.GetReadonly()); err != nil {
|
// First, store admin credentials - those are needed for creating a user
|
||||||
|
|
||||||
|
adminCr, err := getAdminCredentials(req.GetNodePublishSecrets())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = storeCephAdminCredentials(volUuid, adminCr); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then create the user
|
||||||
|
|
||||||
|
if ent, err := createCephUser(volOptions, adminCr, volUuid); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
cr.id = ent.Entity[len(cephEntityClientPrefix):]
|
cr.id = ent.Entity[len(cephEntityClientPrefix):]
|
||||||
|
Loading…
Reference in New Issue
Block a user