From 00b862bb9ae6f12ab9eb4f65f3c798f00922fecd Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Sun, 30 Apr 2023 14:44:06 +0200 Subject: Ignore path on hosted when model-id is set --- .../java/com/yahoo/vespa/model/container/xml/ModelIdResolver.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'config-model/src/main') diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ModelIdResolver.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ModelIdResolver.java index 0e52e56d653..ff261d2b83a 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ModelIdResolver.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ModelIdResolver.java @@ -51,11 +51,15 @@ public class ModelIdResolver { /** Expands a model config value into regular config values. */ private static void transformModelValue(Element value, boolean hosted) { if ( ! value.hasAttribute("model-id")) return; - if (hosted) + + if (hosted) { value.setAttribute("url", modelIdToUrl(value.getTagName(), value.getAttribute("model-id"))); - else if ( ! value.hasAttribute("url") && ! value.hasAttribute("path")) + value.removeAttribute("path"); + } + else if ( ! value.hasAttribute("url") && ! value.hasAttribute("path")) { throw new IllegalArgumentException(value.getTagName() + " is configured with only a 'model-id'. " + "Add a 'path' or 'url' to deploy this outside Vespa Cloud"); + } } private static String modelIdToUrl(String valueName, String modelId) { -- cgit v1.2.3