Skip to content

Commit 3c851c5

Browse files
committed
Get environment variables from radius definition
1 parent 9d97947 commit 3c851c5

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/confcom/azext_confcom/command/containers_from_radius.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,27 @@ def containers_from_radius(
5656
"Applications.Core/containers",
5757
}]
5858

59-
container = supported_resources[container_index]
60-
image = container.get("properties", {}).get("container", {}).get("image")
59+
container = supported_resources[container_index].get("properties", {}).get("container", {})
60+
image = container.get("image")
6161

6262
mounts = {
6363
"aci": ACI_MOUNTS,
6464
}.get(platform, None)
6565

66+
image_config = get_image_config(image)
67+
image_config["env_rules"] += [
68+
{
69+
"pattern": f"{k}={v["value"]}",
70+
"strategy": "string",
71+
"required": False,
72+
}
73+
for k, v in container.get("env", {}).items()
74+
]
75+
6676
return json.dumps({
6777
"id": image,
6878
"name": image,
6979
"layers": get_image_layers(image),
7080
**({"mounts": mounts} if mounts else {}),
71-
**get_image_config(image),
81+
**image_config,
7282
})

0 commit comments

Comments
 (0)