[RFC] Add support for using PVC name as the Share name and ability to skip the share prefix #96
+55
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey all, wanted to get people's thoughts on a couple of changes I'd like to propose/ask-for.
The aim of these are to mainly to allow users to specify the name of the synology share name to be created or used.
I basically wanted to a) define the names of the shared, and b) use existing shares without having to rename them or use a separate CSI Samba plugin.
This PR/proposal is adding a couple of (off-by-default) options:
skip_lun_prefix
andskip_share_prefix
options in theclient-info
config.Setting this to true will skip the prefix being added to the share name.
use_pvc_name
option in theStorageClass
parameters.Setting this to true will use the CSI provided parameter
csi.storage.k8s.io/pvc/name
as the share name.Ideally I would have liked to be able to provide a name for the volume directly, but from a quick Google and lurk in the CSI interface issues, it doesn't seem to be a way to pass PVC parameters to CSI plugins by design.
In combination, (1) and (2) allow you to use an existing share (as long as the share quota matches the requrested capacity).
I've only been using this plugin for a day or so, so I'm not sure if there is a reason why this shouldn't be supported or if there are additional things I might have missed in the code that require changing, as the lack of tests make it a bit hard to ensure I didn't break things.
I've deployed this in a local cluster and it seems to be working as expected with Samba shared both at creating new ones with the expected names, as well as reusing existing ones.
Now to the questions at hand:
a) Is this a feature you'd be interested in?
b) Would there be an alternative way to do this that you'd preffer to see for either (1) or (2)?
c) The code in this repo isn't really formatted, and in order to keep the PR more readable I've opted to not commit the fmt changes that go fmt is really insisting on.
Let me know I'd be happy to make any changes need to accomodate as I'd really not want to have to maintain a fork just for this. :)
Thank you for taking the time to build this plugin, it's really appreciated. 🙏
Happy winter holidays and such! 🎄
Kind regards, @geoah