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

[cinder-csi-plugin] ephemeral volume removal (#2602) #2640

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

sergelogvinov
Copy link
Contributor

@sergelogvinov sergelogvinov commented Sep 3, 2024

What this PR does / why we need it:

Remove openstack credits from node plugin

Which issue this PR fixes(if applicable):

step 2 of #2599

Special notes for reviewers:

Release note:

the flag node-service-no-os-client was deprecated

Manual tests:

  • create/delete
  • snapshot create/delete
  • create from clone

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Sep 3, 2024
@k8s-ci-robot k8s-ci-robot requested review from dulek and zetaab September 3, 2024 15:38
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @sergelogvinov. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 3, 2024
@sergelogvinov sergelogvinov force-pushed the no-ephemeral-2 branch 6 times, most recently from 5c01745 to 1912d64 Compare September 4, 2024 13:18
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Sep 4, 2024
@sergelogvinov sergelogvinov marked this pull request as ready for review September 4, 2024 14:10
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 4, 2024
@sergelogvinov
Copy link
Contributor Author

When you have a time, can you take a look on this changes @jichenjc @dulek

I think it's ready to go, but we need to wait for the official release first.
Thanks.

@zetaab
Copy link
Member

zetaab commented Sep 4, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 4, 2024
@kayrus
Copy link
Contributor

kayrus commented Sep 11, 2024

@sergelogvinov could you please rebase your PR?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 11, 2024
@sergelogvinov
Copy link
Contributor Author

@kayrus done.

Thank you!

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 2, 2024
@sergelogvinov sergelogvinov force-pushed the no-ephemeral-2 branch 3 times, most recently from 41fa616 to 5d211c1 Compare October 2, 2024 08:48
@sergelogvinov
Copy link
Contributor Author

I truly appreciate the opportunity to improve this code (plugin), and we have several suggestions and ideas regarding cmd/cinder-csi-plugin/main.go. However, I believe it would be more efficient to implement these changes in a separate PR, as we can do it in parallel with others PRs.

For now, I have removed any flags or changes related to this file. This PR is currently blocking me, and I am unable to move forward with my other PRs.

Thank you for your understanding!

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 2, 2024
@sergelogvinov
Copy link
Contributor Author

@dulek, @jichenjc, @kayrus, @mdbooth Is there anything else I can do to help here?

Copy link
Contributor

@kayrus kayrus left a comment

Choose a reason for hiding this comment

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

I have a couple of minor suggestions. The rest is LGTM.
Thank you for your patience.

cmd/cinder-csi-plugin/main.go Outdated Show resolved Hide resolved
cmd/cinder-csi-plugin/main.go Outdated Show resolved Hide resolved
@kayrus
Copy link
Contributor

kayrus commented Oct 9, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 9, 2024
@kayrus
Copy link
Contributor

kayrus commented Oct 10, 2024

@zetaab @dulek if you don't have objections, I'll approve this PR tomorrow

Copy link
Contributor

@kayrus kayrus left a comment

Choose a reason for hiding this comment

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

I made yet another review round and have a couple of new question.

pkg/csi/cinder/nodeserver.go Outdated Show resolved Hide resolved
Comment on lines 304 to 310
// setup for test
tempDir := os.TempDir()
defer os.Remove(tempDir)
volumePath := filepath.Join(tempDir, FakeTargetPath)
err := os.MkdirAll(volumePath, 0750)
if err != nil {
t.Fatalf("Failed to set up volumepath: %v", err)
}
Copy link
Contributor

@kayrus kayrus Oct 10, 2024

Choose a reason for hiding this comment

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

Of the tempDir has child objects, the remove will fail. We need a recursive remove.

Suggested change
// setup for test
tempDir := os.TempDir()
defer os.Remove(tempDir)
volumePath := filepath.Join(tempDir, FakeTargetPath)
err := os.MkdirAll(volumePath, 0750)
if err != nil {
t.Fatalf("Failed to set up volumepath: %v", err)
}
// setup for test
tempDir := os.TempDir()
volumePath := filepath.Join(tempDir, FakeTargetPath)
err := os.MkdirAll(volumePath, 0750)
if err != nil {
t.Fatalf("Failed to set up volumepath: %v", err)
}
defer os.RemoveAll(tempDir)

Copy link
Contributor Author

@sergelogvinov sergelogvinov Oct 11, 2024

Choose a reason for hiding this comment

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

Good catch. defer os.RemoveAll(tempDir) -> defer os.RemoveAll(volumePath)

os.TempDir() - returns /tmp folder, it does not create any folders, os.RemoveAll(tempDir) can remove /tmp during the tests...

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 11, 2024
Remove openstack credits from node plugin

Signed-off-by: Serge Logvinov <[email protected]>
@kayrus
Copy link
Contributor

kayrus commented Oct 14, 2024

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 14, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kayrus

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 Oct 14, 2024
@k8s-ci-robot k8s-ci-robot merged commit a294df6 into kubernetes:master Oct 14, 2024
12 checks passed
@sergelogvinov sergelogvinov deleted the no-ephemeral-2 branch October 15, 2024 17:06
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants