@@ -21,12 +21,13 @@ pub struct CoreConfig {
2121 pub pod_selector_label : String ,
2222 pub use_crio_config : bool ,
2323 pub ignore_crio : bool ,
24+ pub timeout : u32 ,
25+ pub compression : bool ,
2426 pub image_command : ImageCommand ,
2527 pub bin_path : String ,
2628 pub os_hostname : String ,
2729 pub filename_template : String ,
2830 pub params : CoreParams ,
29- pub disable_compression : bool ,
3031}
3132
3233#[ derive( Serialize ) ]
@@ -39,7 +40,6 @@ pub struct CoreParams {
3940 pub directory : String ,
4041 pub hostname : String ,
4142 pub pathname : String ,
42- pub timeout : u64 ,
4343 pub namespace : Option < String > ,
4444 pub podname : Option < String > ,
4545 pub uuid : Uuid ,
@@ -58,12 +58,12 @@ impl CoreConfig {
5858 let directory = matches. value_of ( "directory" ) . unwrap_or ( "" ) . to_string ( ) ;
5959 let hostname = matches. value_of ( "hostname" ) . unwrap_or ( "" ) . to_string ( ) ;
6060 let pathname = matches. value_of ( "pathname" ) . unwrap_or ( "" ) . to_string ( ) ;
61- let timeout = matches
62- . value_of ( "timeout" )
63- . unwrap_or ( "600" )
64- . parse :: < u64 > ( )
65- . unwrap ( ) ;
66- let disable_compression = matches. contains_id ( "disable-compression" ) ;
61+ // let timeout = matches
62+ // .value_of("timeout")
63+ // .unwrap_or("600")
64+ // .parse::<u64>()
65+ // .unwrap();
66+ // let disable_compression = matches.contains_id("disable-compression");
6767
6868 let uuid = Uuid :: new_v4 ( ) ;
6969
@@ -76,7 +76,6 @@ impl CoreConfig {
7676 directory,
7777 hostname,
7878 pathname,
79- timeout,
8079 namespace : None ,
8180 podname : None ,
8281 uuid,
@@ -112,6 +111,14 @@ impl CoreConfig {
112111 . unwrap_or_else ( |_| "false" . to_string ( ) . to_lowercase ( ) )
113112 . parse :: < bool > ( )
114113 . unwrap ( ) ;
114+ let compression = env:: var ( "COMPRESSION" )
115+ . unwrap_or_else ( |_| "true" . to_string ( ) . to_lowercase ( ) )
116+ . parse :: < bool > ( )
117+ . unwrap ( ) ;
118+ let timeout = env:: var ( "TIMEOUT" )
119+ . unwrap_or_else ( |_| "600" . to_string ( ) )
120+ . parse :: < u32 > ( )
121+ . unwrap ( ) ;
115122 let os_hostname = hostname:: get ( )
116123 . unwrap_or_else ( |_| OsString :: from_str ( "unknown" ) . unwrap_or_default ( ) )
117124 . into_string ( )
@@ -146,7 +153,8 @@ impl CoreConfig {
146153 filename_template,
147154 log_length,
148155 params,
149- disable_compression,
156+ compression,
157+ timeout,
150158 } )
151159 }
152160
0 commit comments