Skip to content

Commit

Permalink
fix(cachi2): processing of env vars
Browse files Browse the repository at this point in the history
Fixing format of envvars, Cachi2 have slightly different format

Signed-off-by: Martin Basti <[email protected]>
  • Loading branch information
MartinBasti committed Oct 18, 2024
1 parent d44b461 commit 81d7eed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion atomic_reactor/utils/cachi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def generate_request_json(
"pkg_managers": remote_source.get("pkg_managers", []),
"ref": remote_source["ref"],
"repo": remote_source["repo"],
"environment_variables": {key: val["value"] for key, val in remote_source_env_json.items()},
"environment_variables": {env['name']: env["value"] for env in remote_source_env_json},
"flags": remote_source.get("flags", []),
"packages": [], # this will be always empty cachi2 doesn't provide nested deps
}
Expand Down
10 changes: 5 additions & 5 deletions tests/utils/test_cachi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,12 @@ def test_generate_request_json():
],
}

remote_source_env_json = {
"GOCACHE": {
"kind": "path",
"value": "deps/gomod"
remote_source_env_json = [
{
"name":"GOCACHE",
"value": "deps/gomod",
},
}
]

expected = {
"dependencies": [
Expand Down

0 comments on commit 81d7eed

Please sign in to comment.