mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
Add volumesize roundoff for expandrequest
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
ac09c5553c
commit
671e2d814a
@ -58,6 +58,7 @@ jobs:
|
||||
- make dep-check || travis_terminate 1;
|
||||
|
||||
- name: cephcsi with kube 1.13.7
|
||||
env: K8S_FEATURE_GATES="BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true"
|
||||
script:
|
||||
- scripts/skip-doc-change.sh || travis_terminate 0;
|
||||
- make image-cephcsi || travis_terminate 1;
|
||||
|
@ -72,6 +72,7 @@ spec:
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--csiTimeout={{ .Values.provisioner.timeout }}"
|
||||
- "--leader-election"
|
||||
env:
|
||||
- name: ADDRESS
|
||||
|
@ -46,6 +46,7 @@ rules:
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["volumeattachments"]
|
||||
verbs: ["get", "list", "watch", "update"]
|
||||
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -40,7 +40,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v=5"
|
||||
- "--timeout=60s"
|
||||
- "--timeout=150s"
|
||||
- "--enable-leader-election=true"
|
||||
- "--leader-election-type=leases"
|
||||
- "--retry-interval-start=500ms"
|
||||
@ -56,6 +56,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v=5"
|
||||
- "--csiTimeout=150s"
|
||||
- "--leader-election"
|
||||
env:
|
||||
- name: ADDRESS
|
||||
|
@ -324,13 +324,15 @@ func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
}
|
||||
|
||||
if err = createVolume(ctx, volOptions, cr, volumeID(volIdentifier.FsSubvolName), req.GetCapacityRange().GetRequiredBytes()); err != nil {
|
||||
RoundOffSize := util.RoundOffBytes(req.GetCapacityRange().GetRequiredBytes())
|
||||
|
||||
if err = createVolume(ctx, volOptions, cr, volumeID(volIdentifier.FsSubvolName), RoundOffSize); err != nil {
|
||||
klog.Errorf("failed to expand volume %s: %v", volumeID(volIdentifier.FsSubvolName), err)
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
return &csi.ControllerExpandVolumeResponse{
|
||||
CapacityBytes: req.GetCapacityRange().GetRequiredBytes(),
|
||||
CapacityBytes: RoundOffSize,
|
||||
NodeExpansionRequired: false,
|
||||
}, nil
|
||||
|
||||
|
@ -63,7 +63,7 @@ CEPHCSI_IMAGE_REPO=${CEPHCSI_IMAGE_REPO:-"quay.io/cephcsi"}
|
||||
K8S_IMAGE_REPO=${K8S_IMAGE_REPO:-"quay.io/k8scsi"}
|
||||
|
||||
#feature-gates for kube
|
||||
K8S_FEATURE_GATES=${K8S_FEATURE_GATES:-"BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true,ExpandCSIVolumes=true,ExpandInUsePersistentVolumes=true"}
|
||||
K8S_FEATURE_GATES=${K8S_FEATURE_GATES:-"BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true,ExpandCSIVolumes=true"}
|
||||
|
||||
case "${1:-}" in
|
||||
up)
|
||||
|
Loading…
Reference in New Issue
Block a user