mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
Make parameter pool
optional in CephFS storageclass
Signed-off-by: Daniel-Pivonka <dpivonka@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
5b461a0787
commit
0063727199
@ -94,8 +94,8 @@ func createVolume(volOptions *volumeOptions, cr *util.Credentials, volID volumeI
|
||||
klog.V(4).Infof("cephfs: created subvolume group csi")
|
||||
cephfsInit = true
|
||||
}
|
||||
err := execCommandErr(
|
||||
"ceph",
|
||||
|
||||
args := []string{
|
||||
"fs",
|
||||
"subvolume",
|
||||
"create",
|
||||
@ -104,12 +104,20 @@ func createVolume(volOptions *volumeOptions, cr *util.Credentials, volID volumeI
|
||||
strconv.FormatInt(bytesQuota, 10),
|
||||
"--group_name",
|
||||
csiSubvolumeGroup,
|
||||
"--pool_layout", volOptions.Pool,
|
||||
"--mode", "777",
|
||||
"-m", volOptions.Monitors,
|
||||
"-c", util.CephConfigPath,
|
||||
"-n", cephEntityClientPrefix+cr.ID,
|
||||
"--keyfile="+cr.KeyFile)
|
||||
"-n", cephEntityClientPrefix + cr.ID,
|
||||
"--keyfile=" + cr.KeyFile,
|
||||
}
|
||||
|
||||
if volOptions.Pool != "" {
|
||||
args = append(args, "--pool_layout", volOptions.Pool)
|
||||
}
|
||||
|
||||
err := execCommandErr(
|
||||
"ceph",
|
||||
args[:]...)
|
||||
if err != nil {
|
||||
klog.Errorf("failed to create subvolume %s(%s) in fs %s", string(volID), err, volOptions.FsName)
|
||||
return err
|
||||
|
@ -134,7 +134,7 @@ func newVolumeOptions(requestName string, size int64, volOptions, secret map[str
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err = extractOption(&opts.Pool, "pool", volOptions); err != nil {
|
||||
if err = extractOptionalOption(&opts.Pool, "pool", volOptions); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ func newVolumeOptionsFromVolID(volID string, volOpt, secrets map[string]string)
|
||||
}
|
||||
|
||||
if volOpt != nil {
|
||||
if err = extractOption(&volOptions.Pool, "pool", volOpt); err != nil {
|
||||
if err = extractOptionalOption(&volOptions.Pool, "pool", volOpt); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user