resources: add support for setting custom samba configuration #357
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.
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