-
Notifications
You must be signed in to change notification settings - Fork 25
resources: add support for setting custom samba configuration #357
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
resources: add support for setting custom samba configuration #357
Conversation
Thanks for the PR. FWIW this is what we implemented in ceph for something similar: |
OK, I will add a key to check if the user already read docs and know the risks that custom configs may lead to unexpected behaviors. Custom settings are ignored if acknowledgement flags are not set:
|
config/crd/bases/samba-operator.samba.org_smbcommonconfigs.yaml
Outdated
Show resolved
Hide resolved
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.
the change generally looks ok to me. I would request that the fix
commits get folded/squashed into the original patches to have a nice clean history. If that's ok but you want help doing so just ask.
Sure, I'd appreciate it if you could help with the commit squash. Thanks! |
First execute Then run
(these are made up ids and commits of course) Edit this to move the fixup commits after the commit that added the comments with typos. I think in your case it's the first unique commit in the branch. Then change
Save and exit the editor. When you squash the commits the tool will give you an opportunity to edit the commit message. Do so if you wish. |
32f7359
to
66ce58d
Compare
Thanks for the clear and detailed explanation! Well...I think I've messed up something at the beginning (I included a commit in master branch) so I force-pushed twice. Please let me know if there are still any other problems. |
@Mergifyio rebase |
Add new fields to handle custom Samba configurations. For [global] section, a new field customGlobalConfig is added under smbCommonConfig to handle custom settings. For individual share configurations, modifications can be made in customShareConfig field under smbShare. This design is chosen because, in group mode, a single server may correspond to several grouped shares. Signed-off-by: FTS152 <[email protected]>
1. Add a key to check if the user already read docs and know the risks that custom configs may lead to unexpected behaviors. Custom settings are ignored if acknowledgement flags are not set if useUnsafeCustomConfig not set to true explicitly. 2. fix comment typoes Co-authored-by: Spencer B. <[email protected]> Signed-off-by: FTS152 <[email protected]>
✅ Branch has been successfully rebased |
66ce58d
to
b7d86f3
Compare
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.
lgtm. Thanks for working on this.
/test centos-ci/sink-clustered/mini-k8s-latest |
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.
lgtm, thanks.
@anoopcs9. Thanks for getting this feature into master. Would it be possible to cut release with this functionality? I think it is important for many usecases (my usecase is that newer versions of IOS needs to have vfs object = streams_xattr set or else shares are read only from IOS |
We are already due for a release. I hope we can get it out sooner rather than later. @phlogistonjohn any further comments? |
Add new fields to handle custom Samba configurations.
For [global] section, a new field
customGlobalConfig
is added undersmbCommonConfig
to handle custom settings. For individual share configurations, modifications can be made incustomShareConfig
field under smbShare. This design is chosen because, in group mode, a single server may correspond to several grouped shares.For example, we can set
customGlobalConfig
insmbCommonConfig
like:During Update() process for configuration, the applyCustomGlobal() function is used to apply the keys and values from
smbCommonConfig.spec.customGlobalConfig.configs
into smb.conf, which will take effect on the deployed server. However, this method currently has some limitations. When samba server is already running, it is not possible to update smb.conf by modifyingsmbCommonconfig
without interrupting the service. This is mainly due to the following constraints:smbCommonConfig
, you also need to import the changed config json to smbd manually (by execute samba-container import in the pod).These limitations are not insurmountable. The ideal solution would be to implement a mechanism that watches for changes to the config.json inside the pod, automatically imports the new configuration into smbd when changes are detected, and we should also improves the logic of the apply function. For now, this commit only provide the ability for modifying samba configurations when deploying a samba server.
Refs #281