|
70 | 70 | TOLERATIONS_OPTIONS_CONFIG_DEFAULT = f"{TOLERATIONS_OPTIONS_CONFIG}-default" |
71 | 71 | DEFAULT_PODDEFAULTS_CONFIG = "default-poddefaults" |
72 | 72 | JWA_CONFIG_FILE = "src/templates/spawner_ui_config.yaml.j2" |
| 73 | +JWA_CONFIG_FILE_DST = "spawner_ui_config.yaml" |
73 | 74 |
|
74 | 75 | IMAGE_CONFIGS = [ |
75 | 76 | JUPYTER_IMAGES_CONFIG, |
@@ -121,6 +122,9 @@ def __init__(self, *args): |
121 | 122 | ) |
122 | 123 | self._container_name = "jupyter-ui" |
123 | 124 | self._container = self.unit.get_container(self._name) |
| 125 | + self._config_storage_name = "config" |
| 126 | + self._logos_storage_name = "logos" |
| 127 | + self._container_meta = self.meta.containers[self._container_name] |
124 | 128 |
|
125 | 129 | # setup context to be used for updating K8S resources |
126 | 130 | self._context = { |
@@ -302,10 +306,11 @@ def _upload_logos_files_to_container(self): |
302 | 306 | splits it into files as expected by the workload, |
303 | 307 | and pushes the files to the container. |
304 | 308 | """ |
| 309 | + logos_storage_path = Path(self._container_meta.mounts[self._logos_storage_name].location) |
305 | 310 | for file_name, file_content in yaml.safe_load( |
306 | 311 | Path("src/logos-configmap.yaml").read_text() |
307 | 312 | )["data"].items(): |
308 | | - logo_file = "/src/apps/default/static/assets/logos/" + file_name |
| 313 | + logo_file = logos_storage_path / file_name |
309 | 314 | self.container.push( |
310 | 315 | logo_file, |
311 | 316 | file_content, |
@@ -474,8 +479,9 @@ def _render_jwa_spawner_inputs( |
474 | 479 |
|
475 | 480 | def _upload_jwa_file_to_container(self, file_content): |
476 | 481 | """Pushes the JWA spawner config file to the workload container.""" |
| 482 | + config_storage_path = Path(self._container_meta.mounts[self._config_storage_name].location) |
477 | 483 | self.container.push( |
478 | | - "/etc/config/spawner_ui_config.yaml", |
| 484 | + config_storage_path / JWA_CONFIG_FILE_DST, |
479 | 485 | file_content, |
480 | 486 | make_dirs=True, |
481 | 487 | ) |
|
0 commit comments