mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rbd: add support for thick provisioning option
Add an option to the StorageClass to support creating fully allocated (thick provisioned) RBD images Signed-off-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
354f395aa1
commit
c417a5d0ba
@ -19,6 +19,8 @@ package rbd
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
|
||||
"github.com/ceph/ceph-csi/internal/journal"
|
||||
@ -116,6 +118,14 @@ func (cs *ControllerServer) parseVolCreateRequest(ctx context.Context, req *csi.
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
}
|
||||
|
||||
tp := "thickProvision"
|
||||
thick := req.GetParameters()[tp]
|
||||
if thick != "" {
|
||||
if rbdVol.ThickProvision, err = strconv.ParseBool(thick); err != nil {
|
||||
return nil, fmt.Errorf("failed to parse %q: %w", tp, err)
|
||||
}
|
||||
}
|
||||
|
||||
rbdVol.RequestName = req.GetName()
|
||||
|
||||
// Volume Size - Default is 1 GiB
|
||||
|
@ -98,6 +98,7 @@ type rbdVolume struct {
|
||||
Encrypted bool
|
||||
readOnly bool
|
||||
Primary bool
|
||||
ThickProvision bool
|
||||
KMS util.EncryptionKMS
|
||||
// Owner is the creator (tenant, Kubernetes Namespace) of the volume.
|
||||
Owner string
|
||||
|
Reference in New Issue
Block a user