Skip to content

Commit

Permalink
fix: Parse custom images with ":" in their name (#160)
Browse files Browse the repository at this point in the history
For 3 of the images (i.e. explainers), the charm attempts to separate
the image name from the tag, splitting the string in two using `:` as a
separator. However, this breaks the installation if the image name
contains that special character, which could be the case if a local
container registry address is provided for instance (e.g.
`172.17.0.2:5000/kserve/alibi-explainer:latest`).

Use `rsplit` to ensure that the rightmost part of the string (following
the last `:`) is parsed as the tag.

Closes #159 

Signed-off-by: Phoevos Kalemkeris <phoevos.kalemkeris@canonical.com>
  • Loading branch information
phoevos authored and misohu committed Sep 26, 2023
1 parent 09515b9 commit ae0cc08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion charms/kserve-controller/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def get_images(
]:
images[f"{image_name}__image"], images[f"{image_name}__version"] = images[
image_name
].split(":")
].rsplit(":", 1)
return images

def _on_kserve_controller_ready(self, event):
Expand Down

0 comments on commit ae0cc08

Please sign in to comment.