Skip to content

Commit ae4e2fd

Browse files
committed
feat: Adding an specific requisite check for pulling the TG image
1 parent f3d8f04 commit ae4e2fd

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

dk-installer.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,9 +986,17 @@ def get_minikube_parser():
986986
)
987987
REQ_DOCKER_DAEMON = Requirement(
988988
"DOCKER_ENGINE",
989-
("docker", "info"),
989+
("docker", "system", "events", "--since=0m", "--until=0m"),
990990
("The Docker engine is not running.", "Start the Docker engine and try again."),
991991
)
992+
REQ_TESTGEN_IMAGE = Requirement(
993+
"TESTGEN_IMAGE",
994+
("docker", "manifest", "inspect", "{image}"),
995+
(
996+
"The Docker engine could not access the TestGen's image.",
997+
"Make sure your networking policy allows Docker to pull the {image} image.",
998+
),
999+
)
9921000

9931001

9941002
class AnalyticsMultiStepAction(MultiStepAction):
@@ -2046,7 +2054,7 @@ class TestgenInstallAction(TestgenActionMixin, AnalyticsMultiStepAction):
20462054
intro_text = ["This process may take 5~10 minutes depending on your system resources and network speed."]
20472055

20482056
args_cmd = "install"
2049-
requirements = [REQ_DOCKER, REQ_DOCKER_DAEMON]
2057+
requirements = [REQ_DOCKER, REQ_DOCKER_DAEMON, REQ_TESTGEN_IMAGE]
20502058

20512059
def __init__(self):
20522060
super().__init__()
@@ -2115,6 +2123,7 @@ def requirements(self):
21152123
return [
21162124
REQ_DOCKER,
21172125
REQ_DOCKER_DAEMON,
2126+
REQ_TESTGEN_IMAGE,
21182127
Requirement(
21192128
"TG_COMPOSE_FILE",
21202129
(

tests/test_tg_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def get_compose_content(*extra_vars):
6060

6161
@pytest.mark.integration
6262
def test_tg_upgrade_compose_missing(tg_upgrade_action, args_mock, start_cmd_mock, console_msg_mock):
63-
start_cmd_mock.__exit__.side_effect = [None, None, CommandFailed]
63+
start_cmd_mock.__exit__.side_effect = [None, None, None, CommandFailed]
6464

6565
with pytest.raises(AbortAction, match=""):
6666
tg_upgrade_action._check_requirements(args_mock)

0 commit comments

Comments
 (0)