Skip to content

Commit e7e7c74

Browse files
committed
add inquirer option to set pullPolicy
1 parent 5773805 commit e7e7c74

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/warnet/graph.py

+14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def custom_graph(
2525
fork_obs_query_interval: int,
2626
caddy: bool,
2727
logging: bool,
28+
force_pull: bool
2829
):
2930
try:
3031
datadir.mkdir(parents=False, exist_ok=False)
@@ -83,6 +84,10 @@ def custom_graph(
8384
# Configure logging
8485
defaults_yaml_content["collectLogs"] = logging
8586

87+
# Set pullPolicy
88+
if force_pull:
89+
defaults_yaml_content["image"]["pullPolicy"] = "Always"
90+
8691
with open(os.path.join(datadir, "node-defaults.yaml"), "w") as f:
8792
yaml.dump(defaults_yaml_content, f, default_flow_style=False, sort_keys=False)
8893

@@ -123,6 +128,14 @@ def inquirer_create_network(project_path: Path):
123128
choices=SUPPORTED_TAGS,
124129
default=DEFAULT_TAG,
125130
),
131+
132+
inquirer.Confirm(
133+
"force_pull",
134+
message=click.style(
135+
"Would you like to force-pull bitcoin node images from dockerhub?", fg="blue", bold=True
136+
),
137+
default=False,
138+
),
126139
]
127140

128141
net_answers = inquirer.prompt(questions)
@@ -197,6 +210,7 @@ def inquirer_create_network(project_path: Path):
197210
fork_observer_query_interval,
198211
caddy,
199212
logging,
213+
net_answers["force_pull"],
200214
)
201215
return custom_network_path
202216

0 commit comments

Comments
 (0)