-
Notifications
You must be signed in to change notification settings - Fork 601
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
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 Once the patch is verified, the new status will be reflected by the 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. |
5c01745
to
1912d64
Compare
1912d64
to
0747317
Compare
/ok-to-test |
@sergelogvinov could you please rebase your PR? |
0747317
to
bb8a24a
Compare
bb8a24a
to
a002f62
Compare
@kayrus done. Thank you! |
/test pull-cloud-provider-openstack-check |
1 similar comment
/test pull-cloud-provider-openstack-check |
b9de18d
to
f154edb
Compare
I've changed the golangci-lint version to 1.61.0, and test |
@sergelogvinov I submitted a more agnostic PR that allows to run node service without credentials: #2655 |
PR needs rebase. 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. |
f154edb
to
d9e9d6f
Compare
f3ca7fd
to
8a2fa6c
Compare
cmd/cinder-csi-plugin/main.go
Outdated
|
||
d.SetupNodeService(clouds[cloudNames[0]], mount, metadata, additionalTopologies) | ||
d.SetupNodeService(mount, metadata, rescanOnResize, nodeVolumeAttachLimit, additionalTopologies) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to pass a struct instead of a number of vars. https://refactoring.guru/smells/long-parameter-list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch to openstack.BlockStorageOpts{}
cmd/cinder-csi-plugin/main.go
Outdated
//Initialize mount | ||
mount := mount.GetMountProvider() | ||
|
||
//Backward compatibility, read [BlockStorage] parameters from cloud config | ||
cfg, err := openstack.GetConfigFromFiles(cloudConfig) | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern is a bit uncommon. I'd rather check for err != nil
and handle an error.
pkg/csi/cinder/driver.go
Outdated
@@ -32,6 +32,12 @@ import ( | |||
const ( | |||
driverName = "cinder.csi.openstack.org" | |||
topologyKey = "topology." + driverName + "/zone" | |||
|
|||
// MaxVolumesPerNode is the maximum number of volumes that can be attached to a node | |||
MaxVolumesPerNode = 256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this const come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was hardcoded here
const defaultMaxVolAttachLimit int64 = 256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to configure this value. OpenStack supports different hypervisors and each supports a different amount of attached volumes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just in case, if the const/var doesn't need to be accessed from a different package, it's better to define its name starting with a lower case (non-exported). https://go.dev/tour/basics/3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, --node-volume-attach-limit
flag customize it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MaxVolumesPerNode -> maxVolumesPerNode 👍
8a2fa6c
to
6c66a39
Compare
Remove openstack credits from node plugin Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
6c66a39
to
3a6fcc0
Compare
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:
[BlockStorage]
params from cloud-config).It helps to avoid using the cloud-config on the nodes
Release note:
Manual tests: