Skip to content

Commit

Permalink
Refactor configure-module action to include restore functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Apr 26, 2024
1 parent 6760482 commit 8063865
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions imageroot/actions/clone-module/50configure-module
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ configure_retval = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='conf
"lets_encrypt": os.environ["TRAEFIK_LETS_ENCRYPT"] == 'True',
"host": os.environ["TRAEFIK_HOST"],
"http2https": os.environ["TRAEFIK_HTTP2HTTPS"] == 'True',
"restore": True,
})
agent.assert_exp(configure_retval['exit_code'] == 0, "The configure-module subtask failed!")
5 changes: 4 additions & 1 deletion imageroot/actions/configure-module/02_validate_bcc_server
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ agent.set_weight(os.path.basename(__file__), 0) # Validation step, no task progr
# Try to parse the stdin as JSON.
# If parsing fails, output everything to stderr
data = json.load(sys.stdin)

# we are restoring, do not test
if data.get('restore', False):
sys.exit(0)

# Connect to redis
rdb = agent.redis_connect()

Expand Down
1 change: 1 addition & 0 deletions imageroot/actions/restore-module/50configure-module
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ configure_retval = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='conf
"lets_encrypt": renv["TRAEFIK_LETS_ENCRYPT"] == 'True',
"host": renv["TRAEFIK_HOST"],
"http2https": renv["TRAEFIK_HTTP2HTTPS"] == 'True',
"restore": True,
})
agent.assert_exp(configure_retval['exit_code'] == 0, "The configure-module subtask failed!")

0 comments on commit 8063865

Please sign in to comment.