Skip to content

Commit e875d33

Browse files
committed
feat(toolchain): allow passing environment to functions (#2624)
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
1 parent 9b6888a commit e875d33

File tree

2 files changed

+9
-1
lines changed
  • packages/toolchain/toolchain/src

2 files changed

+9
-1
lines changed

packages/toolchain/toolchain/src/config/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ pub struct Function {
8787
#[serde(default)]
8888
pub networking: FunctionNetworking,
8989
#[serde(default)]
90+
pub runtime: FunctionRuntime,
91+
#[serde(default)]
9092
pub resources: Option<Resources>,
9193
}
9294

@@ -123,6 +125,12 @@ impl FunctionNetworking {
123125
}
124126
}
125127

128+
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Default)]
129+
#[serde(rename_all = "snake_case")]
130+
pub struct FunctionRuntime {
131+
pub environment: Option<HashMap<String, String>>,
132+
}
133+
126134
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
127135
#[serde(rename_all = "snake_case")]
128136
pub struct Resources {

packages/toolchain/toolchain/src/tasks/deploy/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ async fn create_edge_function_actors(
269269
build: None,
270270
build_tags: Some(Some(build_tags.clone())),
271271
runtime: Some(Box::new(models::ActorsCreateActorRuntimeRequest {
272-
environment: None,
272+
environment: function.runtime.environment.clone(),
273273
network: None,
274274
})),
275275
network: Some(Box::new(models::ActorsCreateActorNetworkRequest {

0 commit comments

Comments
 (0)