This repository was archived by the owner on Jul 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ use tokio::runtime::Runtime;
1717use url:: Url ;
1818
1919const SPIN_ADDR : & str = "0.0.0.0:80" ;
20+ /// RUNTIME_CONFIG_PATH specifies the expected location and name of the runtime
21+ /// config for a Spin application. The runtime config should be loaded into the
22+ /// root `/` of the container.
23+ const RUNTIME_CONFIG_PATH : & str = "/runtime-config.toml" ;
2024
2125#[ derive( Clone , Default ) ]
2226pub struct SpinEngine ;
@@ -145,7 +149,11 @@ impl SpinEngine {
145149
146150 // Build trigger config
147151 let loader = loader:: TriggerLoader :: new ( working_dir. clone ( ) , true ) ;
148- let runtime_config = RuntimeConfig :: new ( PathBuf :: from ( "/" ) . into ( ) ) ;
152+ let mut runtime_config = RuntimeConfig :: new ( PathBuf :: from ( "/" ) . into ( ) ) ;
153+ // Load in runtime config if one exists at expected location
154+ if Path :: new ( RUNTIME_CONFIG_PATH ) . exists ( ) {
155+ runtime_config. merge_config_file ( RUNTIME_CONFIG_PATH ) ;
156+ }
149157 let mut builder = TriggerExecutorBuilder :: new ( loader) ;
150158 builder
151159 . hooks ( StdioTriggerHook { } )
You can’t perform that action at this time.
0 commit comments