File tree Expand file tree Collapse file tree
api-snowflake-rest/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ pub struct CoreState {
2424pub enum MetastoreConfig {
2525 ConfigPath ( PathBuf ) ,
2626 ConfigJson ( String ) ,
27+ Env ,
2728 DefaultConfig ,
2829 None ,
2930}
@@ -70,6 +71,14 @@ async fn apply_metastore_bootstrap_config(
7071 metastore_bootstrap_config : MetastoreConfig ,
7172) -> Result < ( ) > {
7273 match metastore_bootstrap_config {
74+ MetastoreConfig :: Env => {
75+ tracing:: info!( "Bootstrapping metastore from environment" ) ;
76+ let config = MetastoreBootstrapConfig :: load_from_env ( ) . context ( MetastoreConfigSnafu ) ?;
77+ config
78+ . apply ( metastore. clone ( ) )
79+ . await
80+ . context ( MetastoreConfigSnafu ) ?;
81+ }
7382 MetastoreConfig :: ConfigPath ( path) => {
7483 tracing:: info!(
7584 path = %path. display( ) ,
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ impl LambdaApp {
8585 let metastore_cfg = if let Some ( config_path) = & config. metastore_config {
8686 MetastoreConfig :: ConfigPath ( config_path. clone ( ) )
8787 } else {
88- MetastoreConfig :: None
88+ MetastoreConfig :: Env
8989 } ;
9090
9191 let metastore_settings_config = MetastoreSettingsConfig :: default ( )
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ async fn async_main(
141141 let metastore_cfg = if let Some ( config_path) = & opts. metastore_config {
142142 MetastoreConfig :: ConfigPath ( config_path. clone ( ) )
143143 } else {
144- MetastoreConfig :: None
144+ MetastoreConfig :: Env
145145 } ;
146146 let core_state = CoreState :: new (
147147 execution_cfg,
You can’t perform that action at this time.
0 commit comments