Skip to content

Commit

Permalink
* Add image pull secret for image processor
Browse files Browse the repository at this point in the history
  • Loading branch information
totycro committed Jul 3, 2024
1 parent a1bb330 commit cc0ebf4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.2.7
* Add image pull secret for image processor

## 1.2.6
* Allow defining process properties from config for ImageProcessor

Expand Down
7 changes: 6 additions & 1 deletion pygeoapi_kubernetes_papermill/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, processor_def: dict) -> None:
self.default_image: str = processor_def["default_image"]
self.command: str = processor_def["command"]
self.allowed_images_regex: str = processor_def["allowed_images_regex"]
# self.image_pull_secret: str = processor_def["image_pull_secret"]
self.image_pull_secret: str = processor_def["image_pull_secret"]
self.s3: Optional[dict[str, str]] = processor_def.get("s3")
self.extra_volumes: list = processor_def["extra_volumes"]
self.extra_volume_mounts: list = processor_def["extra_volume_mounts"]
Expand Down Expand Up @@ -128,6 +128,11 @@ def create_job_pod_spec(
extra_config = self._extra_configs()
extra_podspec = self._extra_podspec(requested)

if self.image_pull_secret:
extra_podspec["image_pull_secrets"] = [
k8s_client.V1LocalObjectReference(name=self.image_pull_secret)
]

image_container = k8s_client.V1Container(
name="notebook",
image=self.default_image,
Expand Down
1 change: 1 addition & 0 deletions tests/test_image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _create_processor(def_override=None):
"extra_volume_mounts": [],
"node_purpose_label_key": "",
"default_node_purpose": "",
"image_pull_secret": "",
"allowed_node_purposes_regex": "",
"tolerations": [],
"allow_fargate": False,
Expand Down

0 comments on commit cc0ebf4

Please sign in to comment.