@@ -67,6 +67,7 @@ impl ApplicationToValidate {
67
67
fn component_source < ' a > (
68
68
& ' a self ,
69
69
trigger : & ' a spin_manifest:: schema:: v2:: Trigger ,
70
+ profile : Option < & str > ,
70
71
) -> anyhow:: Result < ComponentSource < ' a > > {
71
72
let component_spec = trigger
72
73
. component
@@ -75,7 +76,7 @@ impl ApplicationToValidate {
75
76
let ( id, source, dependencies, service_chaining) = match component_spec {
76
77
spin_manifest:: schema:: v2:: ComponentSpec :: Inline ( c) => (
77
78
trigger. id . as_str ( ) ,
78
- & c. source ,
79
+ & c. source ( profile ) ,
79
80
& c. dependencies ,
80
81
spin_loader:: requires_service_chaining ( c) ,
81
82
) ,
@@ -89,7 +90,7 @@ impl ApplicationToValidate {
89
90
} ;
90
91
(
91
92
id,
92
- & component. source ,
93
+ & component. source ( profile ) ,
93
94
& component. dependencies ,
94
95
spin_loader:: requires_service_chaining ( component) ,
95
96
)
@@ -116,11 +117,12 @@ impl ApplicationToValidate {
116
117
117
118
pub ( crate ) async fn components_by_trigger_type (
118
119
& self ,
120
+ profile : Option < & str > ,
119
121
) -> anyhow:: Result < Vec < ( String , Vec < ComponentToValidate < ' _ > > ) > > {
120
122
use futures:: FutureExt ;
121
123
122
124
let components_by_trigger_type_futs = self . triggers ( ) . map ( |( ty, ts) | {
123
- self . components_for_trigger ( ts)
125
+ self . components_for_trigger ( ts, profile )
124
126
. map ( |css| css. map ( |css| ( ty. to_owned ( ) , css) ) )
125
127
} ) ;
126
128
let components_by_trigger_type = try_join_all ( components_by_trigger_type_futs)
@@ -132,16 +134,20 @@ impl ApplicationToValidate {
132
134
async fn components_for_trigger < ' a > (
133
135
& ' a self ,
134
136
triggers : & ' a [ spin_manifest:: schema:: v2:: Trigger ] ,
137
+ profile : Option < & str > ,
135
138
) -> 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) ) ;
137
142
try_join_all ( component_futures) . await
138
143
}
139
144
140
145
async fn load_and_resolve_trigger < ' a > (
141
146
& ' a self ,
142
147
trigger : & ' a spin_manifest:: schema:: v2:: Trigger ,
148
+ profile : Option < & str > ,
143
149
) -> anyhow:: Result < ComponentToValidate < ' a > > {
144
- let component = self . component_source ( trigger) ?;
150
+ let component = self . component_source ( trigger, profile ) ?;
145
151
146
152
let loader = ComponentSourceLoader :: new ( & self . wasm_loader ) ;
147
153
0 commit comments