@@ -84,6 +84,9 @@ pub struct S3SpoolingConfig {
8484}
8585
8686pub struct ResolvedSpoolingProtocolConfig {
87+ /// Properties to add to config.properties
88+ pub config_properties : BTreeMap < String , String > ,
89+
8790 // Properties for spooling-manager.properties
8891 pub spooling_manager_properties : BTreeMap < String , String > ,
8992
@@ -110,22 +113,9 @@ impl ResolvedSpoolingProtocolConfig {
110113 client : Option < & Client > ,
111114 namespace : & str ,
112115 ) -> Result < Self , Error > {
113- let mut spooling_manager_properties = BTreeMap :: new ( ) ;
114-
115- spooling_manager_properties. insert (
116- "protocol.spooling.enabled" . to_string ( ) ,
117- config. enabled . to_string ( ) ,
118- ) ;
119-
120- spooling_manager_properties. insert (
121- "protocol.spooling.shared-secret-key" . to_string ( ) ,
122- format ! ( "${{ENV:{secret}}}" , secret = ENV_SPOOLING_SECRET ) ,
123- ) ;
124-
125- spooling_manager_properties. insert ( "fs.location" . to_string ( ) , config. location . clone ( ) ) ;
126-
127116 let mut resolved_config = Self {
128- spooling_manager_properties,
117+ config_properties : BTreeMap :: new ( ) ,
118+ spooling_manager_properties : BTreeMap :: new ( ) ,
129119 volumes : Vec :: new ( ) ,
130120 volume_mounts : Vec :: new ( ) ,
131121 load_env_from_files : BTreeMap :: new ( ) ,
@@ -144,6 +134,26 @@ impl ResolvedSpoolingProtocolConfig {
144134 }
145135 }
146136
137+ resolved_config. spooling_manager_properties . extend ( [
138+ ( "fs.location" . to_string ( ) , config. location . clone ( ) ) ,
139+ (
140+ "spooling-manager.name" . to_string ( ) ,
141+ "filesystem" . to_string ( ) ,
142+ ) ,
143+ ] ) ;
144+
145+ // Enable spooling protocol
146+ resolved_config. config_properties . extend ( [
147+ (
148+ "protocol.spooling.enabled" . to_string ( ) ,
149+ config. enabled . to_string ( ) ,
150+ ) ,
151+ (
152+ "protocol.spooling.shared-secret-key" . to_string ( ) ,
153+ format ! ( "${{ENV:{secret}}}" , secret = ENV_SPOOLING_SECRET ) ,
154+ ) ,
155+ ] ) ;
156+
147157 // Finally, extend the spooling manager properties with any user configuration
148158 if let Some ( user_config) = config. config_overrides . as_ref ( ) {
149159 resolved_config
@@ -284,17 +294,15 @@ mod tests {
284294 . unwrap ( ) ;
285295
286296 let expected_props = BTreeMap :: from ( [
287- ( "protocol.spooling.enabled" . to_string ( ) , "true" . to_string ( ) ) ,
288- (
289- "protocol.spooling.shared-secret-key" . to_string ( ) ,
290- format ! ( "${{ENV:{}}}" , ENV_SPOOLING_SECRET ) ,
291- ) ,
292297 (
293298 "fs.location" . to_string ( ) ,
294299 "s3://my-bucket/spooling" . to_string ( ) ,
295300 ) ,
301+ (
302+ "spooling-manager.name" . to_string ( ) ,
303+ "filesystem" . to_string ( ) ,
304+ ) ,
296305 ] ) ;
297-
298306 assert_eq ! (
299307 expected_props,
300308 resolved_spooling_config. spooling_manager_properties
@@ -330,11 +338,6 @@ mod tests {
330338 . unwrap ( ) ;
331339
332340 let expected_props = BTreeMap :: from ( [
333- ( "protocol.spooling.enabled" . to_string ( ) , "true" . to_string ( ) ) ,
334- (
335- "protocol.spooling.shared-secret-key" . to_string ( ) ,
336- format ! ( "${{ENV:{}}}" , ENV_SPOOLING_SECRET ) ,
337- ) ,
338341 (
339342 "fs.location" . to_string ( ) ,
340343 "s3://my-bucket/spooling" . to_string ( ) ,
@@ -343,6 +346,10 @@ mod tests {
343346 "protocol.spooling.retrieval-mode" . to_string ( ) ,
344347 "STORAGE" . to_string ( ) ,
345348 ) ,
349+ (
350+ "spooling-manager.name" . to_string ( ) ,
351+ "filesystem" . to_string ( ) ,
352+ ) ,
346353 ] ) ;
347354
348355 assert_eq ! (
0 commit comments