|
16 | 16 | FORK_OBSERVER_CHART,
|
17 | 17 | HELM_COMMAND,
|
18 | 18 | INGRESS_HELM_COMMANDS,
|
| 19 | + LOGGING_CRD_COMMANDS, |
19 | 20 | LOGGING_HELM_COMMANDS,
|
20 | 21 | LOGGING_NAMESPACE,
|
21 | 22 | NAMESPACES_CHART_LOCATION,
|
@@ -87,6 +88,9 @@ def _deploy(directory, debug, namespace, to_all_users):
|
87 | 88 |
|
88 | 89 | if (directory / NETWORK_FILE).exists():
|
89 | 90 | processes = []
|
| 91 | + # Deploy logging CRD first to avoid synchronisation issues |
| 92 | + deploy_logging_crd(directory, debug) |
| 93 | + |
90 | 94 | logging_process = Process(target=deploy_logging_stack, args=(directory, debug))
|
91 | 95 | logging_process.start()
|
92 | 96 | processes.append(logging_process)
|
@@ -146,11 +150,30 @@ def check_logging_required(directory: Path):
|
146 | 150 | return False
|
147 | 151 |
|
148 | 152 |
|
| 153 | +def deploy_logging_crd(directory: Path, debug: bool) -> bool: |
| 154 | + """ |
| 155 | + This function exists so we can parallelise the rest of the loggin stack |
| 156 | + installation |
| 157 | + """ |
| 158 | + if not check_logging_required(directory): |
| 159 | + return False |
| 160 | + |
| 161 | + click.echo( |
| 162 | + "Found collectLogs or metricsExport in network definition, Deploying logging stack CRD" |
| 163 | + ) |
| 164 | + |
| 165 | + for command in LOGGING_CRD_COMMANDS: |
| 166 | + if not stream_command(command): |
| 167 | + print(f"Failed to run Helm command: {command}") |
| 168 | + return False |
| 169 | + return True |
| 170 | + |
| 171 | + |
149 | 172 | def deploy_logging_stack(directory: Path, debug: bool) -> bool:
|
150 | 173 | if not check_logging_required(directory):
|
151 | 174 | return False
|
152 | 175 |
|
153 |
| - click.echo("Found collectLogs or metricsExport in network definition, Deploying logging stack") |
| 176 | + click.echo("Deploying logging stack") |
154 | 177 |
|
155 | 178 | for command in LOGGING_HELM_COMMANDS:
|
156 | 179 | if not stream_command(command):
|
|
0 commit comments