Skip to content

Commit

Permalink
reset agent state in env_status file after sending pingRequest (#1329)
Browse files Browse the repository at this point in the history
* fix agent state after sending reset to TAS

* bump agent version
  • Loading branch information
liyaqin1 authored Nov 9, 2023
1 parent f4988ee commit 712fc0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deploy-agent/deployd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
# 2: puppet applied successfully with changes
PUPPET_SUCCESS_EXIT_CODES = [0, 2]

__version__ = '1.2.52'
__version__ = '1.2.53'
6 changes: 6 additions & 0 deletions deploy-agent/deployd/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ def serve_build(self):
self._env_status.dump_envs(self._envs)
# start to ping server to get the latest deploy goal
self._response = self._client.send_reports(self._envs)
# we only need to send RESET once in one deploy-agent run
if len(self._envs) > 0:
for status in self._envs.values():
if status.report.state == "RESET_BY_SYSTEM":
status.report.state = None
self._env_status.dump_envs(self._envs)

if self._response:
report = self._update_internal_deploy_goal(self._response)
Expand Down

0 comments on commit 712fc0c

Please sign in to comment.