|
4 | 4 | import click
|
5 | 5 | from rich import print as richprint
|
6 | 6 |
|
7 |
| -from .constants import NETWORK_DIR, NETWORK_FILE, WARGAMES_NAMESPACE_PREFIX |
8 |
| -from .deploy import deploy_network, validate_directory |
| 7 | +from .constants import NETWORK_DIR, WARGAMES_NAMESPACE_PREFIX |
9 | 8 | from .k8s import get_kubeconfig_value, get_namespaces_by_prefix, get_service_accounts_in_namespace
|
10 | 9 | from .namespaces import copy_namespaces_defaults, namespaces
|
11 | 10 | from .network import copy_network_defaults
|
@@ -128,28 +127,3 @@ def create_kubeconfigs(kubeconfig_dir, token_duration):
|
128 | 127 | "Users can then use by running `warnet auth <file>` or with kubectl by specifying the --kubeconfig flag or by setting the KUBECONFIG environment variable."
|
129 | 128 | )
|
130 | 129 | click.echo(f"Note: The tokens will expire after {token_duration} seconds.")
|
131 |
| - |
132 |
| - |
133 |
| -@admin.command() |
134 |
| -@click.argument( |
135 |
| - "directory", |
136 |
| - type=click.Path(exists=True, file_okay=False, dir_okay=True), |
137 |
| - callback=validate_directory, |
138 |
| -) |
139 |
| -@click.option("--debug", is_flag=True) |
140 |
| -@click.option( |
141 |
| - "--namespace", |
142 |
| - default=None, |
143 |
| - type=None, |
144 |
| - help="The namespace in which to deploy the network", |
145 |
| -) |
146 |
| -def deploy(directory, debug, namespace): |
147 |
| - """Deploy a warnet with topology loaded from <directory>""" |
148 |
| - directory = Path(directory) |
149 |
| - |
150 |
| - if (directory / NETWORK_FILE).exists(): |
151 |
| - deploy_network(directory, debug, namespace) |
152 |
| - else: |
153 |
| - click.echo( |
154 |
| - "Error: Neither network.yaml nor namespaces.yaml found in the specified directory." |
155 |
| - ) |
0 commit comments