summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2021-02-05 08:39:52 +0000
committerCorentin LABBE <clabbe@baylibre.com>2021-02-05 11:48:15 +0000
commit5d49e030896a59ec83250d93352f3d37ae8ff364 (patch)
treeae4031161b6975fa55bc3c90166637f50eeadc16 /lavalab-gen.py
parent40fc2f87e4c38264d2070a2056657c0cbad217e1 (diff)
Permit to set worker token in boards.yaml
LAVA 2020.09 dropped ZMQ and use now a token to authenticate worker against master. lava-docker already handle this by getting token via lavacli. But we need to support to set token in boards.yaml, this patch permits this. Furthermore, the token was given to worker via --token, but this is bad since token can be found by anyone running ps. A better secure way is to use --token-file.
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index e4b3487..e901eb7 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -407,7 +407,7 @@ def main():
"devices", "dispatcher_ip", "default_slave",
"extra_actions", "export_ser2net", "expose_ser2net", "expose_ports", "env",
"host", "host_healthcheck",
- "loglevel", "lava-coordinator",
+ "loglevel", "lava-coordinator", "lava_worker_token",
"name",
"remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "remote_user_token",
"tags",
@@ -493,6 +493,8 @@ def main():
else:
remote_rpc_port = worker["remote_rpc_port"]
dockcomp["services"][worker_name]["environment"]["LAVA_MASTER"] = remote_address
+ if "lava_worker_token" in worker:
+ dockcomp["services"][worker_name]["environment"]["LAVA_WORKER_TOKEN"] = worker["lava_worker_token"]
remote_user = worker["remote_user"]
# find master
remote_token = "BAD"