Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cephfs: disallow creating small volumes from snapshot/volume #2788

Merged
merged 1 commit into from Mar 17, 2022

Conversation

Madhu-1
Copy link
Collaborator

@Madhu-1 Madhu-1 commented Jan 17, 2022

as per the CSI standard, the size is an optional parameter, as we are allowing the clone to a bigger size today we need to block the clone to a smaller size as its a have side effects like data corruption, etc.

Note:- Even though this check is present in the kubernetes sidecar as CSI is CO independent adding the check here.

fixes: #2718

Signed-off-by: Madhu Rajanna madhupr007@gmail.com

@mergify mergify bot added the component/cephfs Issues related to CephFS label Jan 17, 2022
@Madhu-1 Madhu-1 requested review from a team January 17, 2022 07:21
@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Jan 18, 2022

@Mergifyio rebase

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Jan 18, 2022

Jan 17 11:36:11.447: FAIL: failed to create storageclass: etcdserver: request timed out

@mergify
Copy link
Contributor

mergify bot commented Jan 18, 2022

rebase

✅ Branch has been successfully rebased

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Jan 19, 2022

@ceph/ceph-csi-maintainers @ceph/contributors need a review if anyone has free time.

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Jan 19, 2022

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Jan 19, 2022

rebase

✅ Branch has been successfully rebased

@humblec
Copy link
Collaborator

humblec commented Jan 20, 2022

Actually this will never happen from Kube CO and also on Openshift. In our documentation we have mentioned, only those as tested or Known to Work https://github.com/ceph/ceph-csi#known-to-work-co-platforms .. The confusion this could bring here is, if we started to think about other COs , then many areas have to be looked upon in various code paths..

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Jan 21, 2022

Actually this will never happen from Kube CO and also on Openshift.
In our documentation we have mentioned, only those as tested or Known to Work https://github.com/ceph/ceph-csi#known-to-work-co-platforms .. The confusion this could bring here is, if we started to think about other COs , then many areas have to be looked upon in various code paths..

we never mentioned that this will won't work or we should only fix it as per the kubernetes/OCP requirement. most of the time we will try to align with the standard CSI specification.

@Madhu-1 Madhu-1 requested a review from nixpanic January 21, 2022 12:01
@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Feb 9, 2022

@nixpanic do you have any comments on this one?

@@ -199,6 +234,11 @@ func (cs *ControllerServer) CreateVolume(
defer parentVol.Destroy()
}

err = checkValidCreateVolumeRequest(volOptions, parentVol, pvID, sID)
if err != nil {
return nil, err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just returns the error, instead of converting it to a gRPC error. The checkValidCreateVolumeRequest() function takes care of that, but it would be cleaner to do it here.

Ideally top-level gRPC functions are the only ones that return gRPC errors, all other functions should just return plain errors so that they can be re-used outside of the direct gRPC flow.

nixpanic
nixpanic previously approved these changes Feb 21, 2022
@Madhu-1 Madhu-1 requested a review from a team February 22, 2022 03:24
yati1998
yati1998 previously approved these changes Feb 22, 2022
Copy link
Contributor

@yati1998 yati1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Madhu-1 Madhu-1 added the ci/retry/e2e Label to retry e2e retesting on approved PR's label Feb 22, 2022
@github-actions
Copy link

/retest ci/centos/mini-e2e-helm/k8s-1.22

@github-actions
Copy link

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.22" test failed. Logs are available at location for debugging

@github-actions
Copy link

/retest ci/centos/upgrade-tests-cephfs

@github-actions
Copy link

@Madhu-1 "ci/centos/upgrade-tests-cephfs" test failed. Logs are available at location for debugging

@github-actions
Copy link

/retest ci/centos/k8s-e2e-external-storage/1.22

@github-actions
Copy link

@Madhu-1 "ci/centos/k8s-e2e-external-storage/1.22" test failed. Logs are available at location for debugging

@github-actions
Copy link

/retest ci/centos/mini-e2e-helm/k8s-1.21

@github-actions
Copy link

/retest ci/centos/k8s-e2e-external-storage/1.22

@github-actions
Copy link

@Madhu-1 "ci/centos/k8s-e2e-external-storage/1.22" test failed. Logs are available at location for debugging

@github-actions
Copy link

/retest ci/centos/mini-e2e-helm/k8s-1.22

@github-actions
Copy link

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.22" test failed. Logs are available at location for debugging

@github-actions
Copy link

/retest ci/centos/mini-e2e-helm/k8s-1.23

@github-actions
Copy link

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.23" test failed. Logs are available at location for debugging

@mergify
Copy link
Contributor

mergify bot commented Feb 22, 2022

This pull request now has conflicts with the target branch. Could you please resolve conflicts and force push the corrected changes? 🙏

@mergify mergify bot dismissed stale reviews from nixpanic and yati1998 February 28, 2022 06:24

Pull request has been modified.

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Mar 16, 2022

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Mar 16, 2022

rebase

✅ Branch has been successfully rebased

@github-actions
Copy link

/retest ci/centos/mini-e2e-helm/k8s-1.21

@github-actions
Copy link

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.21" test failed. Logs are available at location for debugging

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Mar 16, 2022

/retest ci/centos/mini-e2e-helm/k8s-1.21

as per the CSI standard the size is optional parameter,
as we are allowing the clone to a bigger size
today we need to block the clone to a smaller size
as its a have side effects like data corruption etc.

Note:- Even though this check is present in kubernetes
sidecar as CSI is CO independent adding the check
here.

fixes: ceph#2718

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@github-actions
Copy link

/retest ci/centos/mini-e2e-helm/k8s-1.21

@github-actions
Copy link

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.21" test failed. Logs are available at location for debugging

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Mar 17, 2022

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Mar 17, 2022

rebase

☑️ Nothing to do

  • -closed [📌 rebase requirement]
  • #commits-behind>0 [📌 rebase requirement]

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Mar 17, 2022

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Mar 17, 2022

refresh

✅ Pull request refreshed

@mergify mergify bot merged commit d357beb into ceph:devel Mar 17, 2022
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/retry/e2e Label to retry e2e retesting on approved PR's component/cephfs Issues related to CephFS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add check to block smaller size PVC creation from snapshot/clone
4 participants