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

Fix listsnapshot clean up #133

Merged
merged 1 commit into from
Nov 8, 2018
Merged

Conversation

wnxn
Copy link
Contributor

@wnxn wnxn commented Nov 1, 2018

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 1, 2018
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 1, 2018
@wnxn
Copy link
Contributor Author

wnxn commented Nov 1, 2018

/assign @lpabon

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

Can you explain in the commit message why this change is needed? In other words, what problem does it fix?

@wnxn
Copy link
Contributor Author

wnxn commented Nov 6, 2018

Hi, @pohly
In some storage server, snapshot is related on a specific volume. If user delete the volume, the snapshot will
be deleted automatically at storage server side. For this reason, we must keep the order of deletion, that is deleting volume‘s snapshots before deleting the volume. It's found that the author might take the order of deletion into consideration when writing other snapshot test cases.
Just like this:

By("cleaning up deleting the snapshot")
delSnapReq := MakeDeleteSnapshotReq(sc, snapshot.GetSnapshot().GetId())
_, err = c.DeleteSnapshot(context.Background(), delSnapReq)
Expect(err).NotTo(HaveOccurred())
By("cleaning up deleting the volume")
delVolReq := MakeDeleteVolumeReq(sc, volume.GetVolume().GetId())
_, err = c.DeleteVolume(context.Background(), delVolReq)
Expect(err).NotTo(HaveOccurred())

@pohly
Copy link
Contributor

pohly commented Nov 6, 2018

But what breaks when the order is as it is now? Does the test fail?

I am trying to understand whether this change works around unexpected behavior of one particular storage backend or is actually broken.

@xing-yang can you perhaps comment on this?

@xing-yang
Copy link
Contributor

xing-yang commented Nov 6, 2018

For some storage systems, snapshot has to be deleted first before deleting the volume. If you delete a volume with dependent snapshot, it may cause error in some storage systems. For example, Cinder prevents you from deleting a volume with dependent snapshots. For Hostpath driver, this is not a problem as the snapshot does not depend on the volume. So this change looks good to me.

Copy link
Contributor

@xing-yang xing-yang left a comment

Choose a reason for hiding this comment

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

lgtm

@pohly
Copy link
Contributor

pohly commented Nov 6, 2018

@wnxn I'm fine with merging this then, but I'd still like to have this information recorded in the commit message. Please use "git commit --amend" and "git push ... +master" to update the PR.

@xing-yang
Copy link
Contributor

Agree that it is better to add clarification in the commit message.

For some storage systems, snapshot has to be deleted first before deleting the volume. If a volume with dependent snapshot was deleted, it may cause error in some storage systems. Therefore, we must keep the order of deletion, that is deleting a volume's snapshots before deleting the volume.
@wnxn
Copy link
Contributor Author

wnxn commented Nov 7, 2018

Thanks for @pohly and @xing-yang 's review.
I add some clarification in commit message. Would you please review again?

@pohly
Copy link
Contributor

pohly commented Nov 7, 2018

/lgtm

Just one comment for future commits: please format commit messages with explicit line breaks in the body, they are easier to read in "git log" then.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2018
@wnxn
Copy link
Contributor Author

wnxn commented Nov 7, 2018

Hi, @pohly
Thanks for your advice. I will format messages body in my future commits.

@pohly
Copy link
Contributor

pohly commented Nov 8, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pohly, wnxn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2018
@k8s-ci-robot k8s-ci-robot merged commit 93231de into kubernetes-csi:master Nov 8, 2018
suneeth51 pushed a commit to suneeth51/csi-test that referenced this pull request Sep 11, 2019
pohly added a commit to pohly/csi-test that referenced this pull request Feb 3, 2021
7bc70e5 Merge pull request kubernetes-csi#129 from pohly/squash-documentation
e0b02e7 README.md: document usage of --squash
316cb95 Merge pull request kubernetes-csi#132 from yiyang5055/bugfix/boilerplate
26e2ab1 fix: default boilerplate path
1add8c1 Merge pull request kubernetes-csi#133 from pohly/kubernetes-1.20-tag
3e811d6 prow.sh: fix "on-master" prow jobs

git-subtree-dir: release-tools
git-subtree-split: 7bc70e5
stmcginnis pushed a commit to stmcginnis/csi-test that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants