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 <mbasti@redhat.com>
  • Loading branch information
MartinBasti committed Nov 5, 2024
1 parent b9a3474 commit 1ddb78f
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 @@ -156,7 +156,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 @@ -409,12 +409,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 1ddb78f

Please sign in to comment.