Skip to content

Commit

Permalink
Use the runner env to properly get the environment on the FLAME runner
Browse files Browse the repository at this point in the history
  • Loading branch information
probably-not committed Jan 7, 2025
1 parent 9fa4853 commit 959a0c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/flame_ec2/ec2_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule FlameEC2.EC2Api do

def build_params_from_state(%BackendState{} = state) do
state.config
|> params_from_config()
|> params_from_config(state.runner_env)
|> Map.merge(instance_tags(state))
|> Map.put("Action", "RunInstances")
|> flatten_json_object()
Expand All @@ -70,9 +70,9 @@ defmodule FlameEC2.EC2Api do
}
end

defp params_from_config(%Config{} = config) do
defp params_from_config(%Config{} = config, env) do
systemd_service = Templates.systemd_service(app: config.app)
env = Templates.env(vars: config.env)
env = Templates.env(vars: env)

start_script =
Templates.start_script(
Expand Down
2 changes: 1 addition & 1 deletion test/flame_ec2/ec2_api_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defmodule FlameEC2.EC2ApiTest do
{:ok, decoded} = Base.decode64(parsed["UserData"])

systemd_service = FlameEC2.Templates.systemd_service(app: state.config.app)
env = FlameEC2.Templates.env(vars: state.config.env)
env = FlameEC2.Templates.env(vars: state.runner_env)

start_script =
FlameEC2.Templates.start_script(
Expand Down

0 comments on commit 959a0c3

Please sign in to comment.