Skip to content

Commit

Permalink
add inquirer option to set pullPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
willcl-ark committed Oct 8, 2024
1 parent 5773805 commit e7e7c74
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/warnet/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def custom_graph(
fork_obs_query_interval: int,
caddy: bool,
logging: bool,
force_pull: bool
):
try:
datadir.mkdir(parents=False, exist_ok=False)
Expand Down Expand Up @@ -83,6 +84,10 @@ def custom_graph(
# Configure logging
defaults_yaml_content["collectLogs"] = logging

# Set pullPolicy
if force_pull:
defaults_yaml_content["image"]["pullPolicy"] = "Always"

with open(os.path.join(datadir, "node-defaults.yaml"), "w") as f:
yaml.dump(defaults_yaml_content, f, default_flow_style=False, sort_keys=False)

Expand Down Expand Up @@ -123,6 +128,14 @@ def inquirer_create_network(project_path: Path):
choices=SUPPORTED_TAGS,
default=DEFAULT_TAG,
),

inquirer.Confirm(
"force_pull",
message=click.style(
"Would you like to force-pull bitcoin node images from dockerhub?", fg="blue", bold=True
),
default=False,
),
]

net_answers = inquirer.prompt(questions)
Expand Down Expand Up @@ -197,6 +210,7 @@ def inquirer_create_network(project_path: Path):
fork_observer_query_interval,
caddy,
logging,
net_answers["force_pull"],
)
return custom_network_path

Expand Down

0 comments on commit e7e7c74

Please sign in to comment.