File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -978,7 +978,7 @@ def _generate_share(
978978 share .cephfs .subvolume ,
979979 share .cephfs .path ,
980980 )
981- return {
981+ cfg = {
982982 # smb.conf options
983983 'options' : {
984984 'path' : path ,
@@ -992,6 +992,12 @@ def _generate_share(
992992 'x:ceph:id' : f'{ share .cluster_id } .{ share .share_id } ' ,
993993 }
994994 }
995+ # extend share with custom options
996+ custom_opts = share .cleaned_custom_smb_share_options
997+ if custom_opts :
998+ cfg ['options' ].update (custom_opts )
999+ cfg ['options' ]['x:ceph:has_custom_options' ] = 'yes'
1000+ return cfg
9951001
9961002
9971003def _generate_config (
@@ -1016,7 +1022,7 @@ def _generate_config(
10161022 for share in shares
10171023 }
10181024
1019- return {
1025+ cfg : Dict [ str , Any ] = {
10201026 'samba-container-config' : 'v0' ,
10211027 'configs' : {
10221028 cluster .cluster_id : {
@@ -1042,6 +1048,14 @@ def _generate_config(
10421048 },
10431049 'shares' : share_configs ,
10441050 }
1051+ # insert global custom options
1052+ custom_opts = cluster .cleaned_custom_smb_global_options
1053+ if custom_opts :
1054+ # isolate custom config opts into a section for cleanliness
1055+ gname = f'{ cluster .cluster_id } _custom'
1056+ cfg ['configs' ][cluster .cluster_id ]['globals' ].append (gname )
1057+ cfg ['globals' ][gname ] = {'options' : dict (custom_opts )}
1058+ return cfg
10451059
10461060
10471061def _generate_smb_service_spec (
You can’t perform that action at this time.
0 commit comments