Skip to content

Commit

Permalink
always pass ca cert on update (#62)
Browse files Browse the repository at this point in the history
* always pass ca cert on update

* revert debug changes

* remove SLY_EXTRA_CA_CERTS from net-client envs if file not found
  • Loading branch information
NikolaiPetukhov authored Feb 1, 2024
1 parent 7e8b320 commit 9aa64d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def _start_net_client(docker_api=None):
if constants.NO_PROXY():
envs.append(f"{constants._NO_PROXY}={constants.NO_PROXY()}")
if constants.SLY_EXTRA_CA_CERTS():
envs.append(f"{constants._SLY_EXTRA_CA_CERTS}={constants.SLY_EXTRA_CA_CERTS()}")
if os.path.exists(constants.SLY_EXTRA_CA_CERTS()):
envs.append(f"{constants._SLY_EXTRA_CA_CERTS}={constants.SLY_EXTRA_CA_CERTS()}")
volumes = [
"/var/run/docker.sock:/tmp/docker.sock:ro",
f"{constants.HOST_DIR()}:{constants.AGENT_ROOT_DIR()}",
Expand Down
2 changes: 2 additions & 0 deletions agent/worker/task_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def task_main_func(self):
_, _, new_ca_cert_path = agent_utils.get_options_changes(envs, volumes, ca_cert)
if new_ca_cert_path and constants.SLY_EXTRA_CA_CERTS() != new_ca_cert_path:
envs[constants._SLY_EXTRA_CA_CERTS] = new_ca_cert_path
else:
envs[constants._SLY_EXTRA_CA_CERTS] = constants.SLY_EXTRA_CA_CERTS()

use_options = True
except agent_utils.AgentOptionsNotAvailable:
Expand Down

0 comments on commit 9aa64d0

Please sign in to comment.