Skip to content

Commit 1837a30

Browse files
authored
fix: variable injection order (#721)
1 parent a47a511 commit 1837a30

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/orchestrator/orchestrator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ func StartApp(
200200

201201
// getAppEnvironmentVariables returns the environment variables for the app by merging variables and config in the following order:
202202
// - brick default variables (variables defined in the brick definition)
203-
// - brick instance variables (variables defined in the app.yaml for the brick instance)
204203
// - model configuration variables (variables defined in the model configuration)
204+
// - brick instance variables (variables defined in the app.yaml for the brick instance)
205205
// In addition, it adds some useful environment variables like APP_HOME and HOST_IP.
206206
func getAppEnvironmentVariables(app app.ArduinoApp, brickIndex *bricksindex.BricksIndex, modelsIndex *modelsindex.ModelsIndex) x.EnvVars {
207207
envs := make(x.EnvVars)
@@ -210,11 +210,12 @@ func getAppEnvironmentVariables(app app.ArduinoApp, brickIndex *bricksindex.Bric
210210
if brickDef, found := brickIndex.FindBrickByID(brick.ID); found {
211211
maps.Insert(envs, brickDef.GetDefaultVariables())
212212
}
213-
maps.Insert(envs, maps.All(brick.Variables))
214213

215214
if m, found := modelsIndex.GetModelByID(brick.Model); found {
216215
maps.Insert(envs, maps.All(m.ModelConfiguration))
217216
}
217+
218+
maps.Insert(envs, maps.All(brick.Variables))
218219
}
219220

220221
// Add the APP_HOME directory to the environment variables

0 commit comments

Comments
 (0)