From 6a52b3e1aadfc262b4ebc452abfb04c8776e758c Mon Sep 17 00:00:00 2001 From: sasvaritoni Date: Fri, 17 May 2019 14:24:36 +0200 Subject: [PATCH] Fix PredictiveUnitState image name and version (#562) --- .../io/seldon/engine/predictors/PredictiveUnitState.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/main/java/io/seldon/engine/predictors/PredictiveUnitState.java b/engine/src/main/java/io/seldon/engine/predictors/PredictiveUnitState.java index 7e9f054992..c545b06532 100644 --- a/engine/src/main/java/io/seldon/engine/predictors/PredictiveUnitState.java +++ b/engine/src/main/java/io/seldon/engine/predictors/PredictiveUnitState.java @@ -87,11 +87,11 @@ public PredictiveUnitState( if (containersMap.containsKey(name)){ this.image = containersMap.get(name).getImage(); - if (image.contains(":")) + int i = image.lastIndexOf(":"); + if (i >= 0) { - String[] parts = image.split(":"); - this.imageName = parts[0]; - this.imageVersion = parts[1]; + this.imageName = StringUtils.substring(image, 0, i); + this.imageVersion = StringUtils.substring(image, i+1); } else {