From a3d2f18592609a10af73fd7798470ec84d26ef24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Skaza?= Date: Mon, 15 Dec 2025 14:09:20 +0100 Subject: [PATCH 1/3] always populate connection info --- ctfcli/cli/challenges.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ctfcli/cli/challenges.py b/ctfcli/cli/challenges.py index fda5ebe..4925c3f 100644 --- a/ctfcli/cli/challenges.py +++ b/ctfcli/cli/challenges.py @@ -753,17 +753,13 @@ def deploy( deployment_result = deployment_handler.deploy(skip_login=skip_login) - # Don't modify the connection_info if it exists already - if challenge_instance.get("connection_info"): - click.secho("Using connection_info from challenge.yml", fg="yellow") - - # Otherwise, use connection_info from the deployment result if provided - elif deployment_result.connection_info: + # Save connection_info from the deployment result if returned + if deployment_result.connection_info: challenge_instance["connection_info"] = deployment_result.connection_info - # Finally, if no connection_info was provided in the challenge and the - # deployment didn't result in one either, just ensure it's not present - else: + # If no connection_info was provided by the challenge + # and the deployment didn't result in one either, just ensure it's not present + elif not challenge_instance.get("connection_info"): challenge_instance["connection_info"] = None if not deployment_result.success: From 23c411b2e4016e6dbee742b167dd7f78af6bc528 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Mon, 15 Dec 2025 12:39:53 -0500 Subject: [PATCH 2/3] Add connection_info update message --- ctfcli/cli/challenges.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ctfcli/cli/challenges.py b/ctfcli/cli/challenges.py index 4925c3f..23b4a48 100644 --- a/ctfcli/cli/challenges.py +++ b/ctfcli/cli/challenges.py @@ -755,6 +755,7 @@ def deploy( # Save connection_info from the deployment result if returned if deployment_result.connection_info: + click.secho("Updating connection_info in challenge.yml", fg="yellow") challenge_instance["connection_info"] = deployment_result.connection_info # If no connection_info was provided by the challenge From 3f4b9df8803d6ea6f5641b98c3bb9842464526dc Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Mon, 15 Dec 2025 12:43:19 -0500 Subject: [PATCH 3/3] Update ctfcli/cli/challenges.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ctfcli/cli/challenges.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctfcli/cli/challenges.py b/ctfcli/cli/challenges.py index 23b4a48..1a7f0fd 100644 --- a/ctfcli/cli/challenges.py +++ b/ctfcli/cli/challenges.py @@ -755,7 +755,7 @@ def deploy( # Save connection_info from the deployment result if returned if deployment_result.connection_info: - click.secho("Updating connection_info in challenge.yml", fg="yellow") + click.secho("Saving connection_info in challenge.yml", fg="yellow") challenge_instance["connection_info"] = deployment_result.connection_info # If no connection_info was provided by the challenge