|
28 | 28 |
|
29 | 29 | import abc |
30 | 30 | import importlib |
| 31 | +import urllib.request |
31 | 32 | from pathlib import Path |
32 | 33 | import sys |
33 | 34 | from typing import Any, Dict, Iterator, Tuple, Union |
@@ -198,6 +199,14 @@ def task(self) -> types.TaskDict: |
198 | 199 | return task |
199 | 200 |
|
200 | 201 |
|
| 202 | +def _download_ui_operator_crds() -> str: |
| 203 | + """Download UI Operator CRDs from GitHub releases.""" |
| 204 | + url = "https://github.com/scality/ui-operator/releases/download/0.1.1/ui-operator-crds-0.1.1.yaml" |
| 205 | + |
| 206 | + with urllib.request.urlopen(url) as response: |
| 207 | + return response.read().decode('utf-8') |
| 208 | + |
| 209 | + |
201 | 210 | PILLAR_FILES: Tuple[Union[Path, targets.AtomicTarget], ...] = ( |
202 | 211 | Path("pillar/metalk8s/roles/bootstrap.sls"), |
203 | 212 | Path("pillar/metalk8s/roles/ca.sls"), |
@@ -412,6 +421,16 @@ def task(self) -> types.TaskDict: |
412 | 421 | Path("salt/metalk8s/addons/ui-operator/deployed/init.sls"), |
413 | 422 | Path("salt/metalk8s/addons/ui-operator/deployed/manifests.sls"), |
414 | 423 | Path("salt/metalk8s/addons/ui-operator/deployed/namespace.sls"), |
| 424 | + targets.TemplateFile( |
| 425 | + task_name="ui-operator-crds.sls", |
| 426 | + source=constants.ROOT.joinpath( |
| 427 | + "salt/metalk8s/addons/ui-operator/deployed/crds.sls.in" |
| 428 | + ), |
| 429 | + destination=constants.ISO_ROOT.joinpath( |
| 430 | + "salt/metalk8s/addons/ui-operator/deployed/crds.sls" |
| 431 | + ), |
| 432 | + context={"CRDs": _download_ui_operator_crds()}, |
| 433 | + ), |
415 | 434 | Path("salt/metalk8s/addons/ui-operator/post-upgrade.sls"), |
416 | 435 | Path("salt/metalk8s/addons/solutions/deployed/configmap.sls"), |
417 | 436 | Path("salt/metalk8s/addons/solutions/deployed/init.sls"), |
|
0 commit comments