@@ -67,6 +67,7 @@ impl ApplicationToValidate {
6767 fn component_source < ' a > (
6868 & ' a self ,
6969 trigger : & ' a spin_manifest:: schema:: v2:: Trigger ,
70+ profile : Option < & str > ,
7071 ) -> anyhow:: Result < ComponentSource < ' a > > {
7172 let component_spec = trigger
7273 . component
@@ -75,7 +76,7 @@ impl ApplicationToValidate {
7576 let ( id, source, dependencies, service_chaining) = match component_spec {
7677 spin_manifest:: schema:: v2:: ComponentSpec :: Inline ( c) => (
7778 trigger. id . as_str ( ) ,
78- & c. source ,
79+ & c. source ( profile ) ,
7980 & c. dependencies ,
8081 spin_loader:: requires_service_chaining ( c) ,
8182 ) ,
@@ -89,7 +90,7 @@ impl ApplicationToValidate {
8990 } ;
9091 (
9192 id,
92- & component. source ,
93+ & component. source ( profile ) ,
9394 & component. dependencies ,
9495 spin_loader:: requires_service_chaining ( component) ,
9596 )
@@ -116,11 +117,12 @@ impl ApplicationToValidate {
116117
117118 pub ( crate ) async fn components_by_trigger_type (
118119 & self ,
120+ profile : Option < & str > ,
119121 ) -> anyhow:: Result < Vec < ( String , Vec < ComponentToValidate < ' _ > > ) > > {
120122 use futures:: FutureExt ;
121123
122124 let components_by_trigger_type_futs = self . triggers ( ) . map ( |( ty, ts) | {
123- self . components_for_trigger ( ts)
125+ self . components_for_trigger ( ts, profile )
124126 . map ( |css| css. map ( |css| ( ty. to_owned ( ) , css) ) )
125127 } ) ;
126128 let components_by_trigger_type = try_join_all ( components_by_trigger_type_futs)
@@ -132,16 +134,20 @@ impl ApplicationToValidate {
132134 async fn components_for_trigger < ' a > (
133135 & ' a self ,
134136 triggers : & ' a [ spin_manifest:: schema:: v2:: Trigger ] ,
137+ profile : Option < & str > ,
135138 ) -> anyhow:: Result < Vec < ComponentToValidate < ' a > > > {
136- let component_futures = triggers. iter ( ) . map ( |t| self . load_and_resolve_trigger ( t) ) ;
139+ let component_futures = triggers
140+ . iter ( )
141+ . map ( |t| self . load_and_resolve_trigger ( t, profile) ) ;
137142 try_join_all ( component_futures) . await
138143 }
139144
140145 async fn load_and_resolve_trigger < ' a > (
141146 & ' a self ,
142147 trigger : & ' a spin_manifest:: schema:: v2:: Trigger ,
148+ profile : Option < & str > ,
143149 ) -> anyhow:: Result < ComponentToValidate < ' a > > {
144- let component = self . component_source ( trigger) ?;
150+ let component = self . component_source ( trigger, profile ) ?;
145151
146152 let loader = ComponentSourceLoader :: new ( & self . wasm_loader ) ;
147153
0 commit comments