summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-11-09 13:37:30 +0100
committerJon Bratseth <bratseth@gmail.com>2022-11-09 13:37:30 +0100
commit365d06991258a441899d731483a2ab03ae428ee3 (patch)
treeb35e97cb8a95004f092d44c681297b37b607178d /config
parentfc4d90eb222166c4ccb1fd5687a8cf1ccf0d5362 (diff)
Don't resolve serverside
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/ConfigPayloadApplier.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/config/src/main/java/com/yahoo/vespa/config/ConfigPayloadApplier.java b/config/src/main/java/com/yahoo/vespa/config/ConfigPayloadApplier.java
index b50c38792c1..1e90f3974a5 100644
--- a/config/src/main/java/com/yahoo/vespa/config/ConfigPayloadApplier.java
+++ b/config/src/main/java/com/yahoo/vespa/config/ConfigPayloadApplier.java
@@ -231,29 +231,32 @@ public class ConfigPayloadApplier<T extends ConfigInstance.Builder> {
return getValueFromInspector(value);
}
+ /**
+ * This may run on both the config server and subscribing nodes.
+ * We only have a urlDownloader set up when client side.
+ */
+ private boolean isClientside() {
+ return urlDownloader != null;
+ }
+
private FileReference resolvePath(String value) {
Path path = pathAcquirer.getPath(new FileReference(value));
return new FileReference(path.toString());
}
private UrlReference resolveUrl(String url) {
- if (! canResolveUrls()) // assuming config server - keep the url
- return new UrlReference(url);
+ if ( ! isClientside()) return new UrlReference(url);
File file = urlDownloader.waitFor(new UrlReference(url), 60 * 60);
return new UrlReference(file.getAbsolutePath());
}
- private boolean canResolveUrls() {
- return urlDownloader != null;
- }
-
private ModelReference resolveModel(String modelStringValue) {
var model = ModelReference.valueOf(modelStringValue);
if (model.isResolved())
return model;
- if (model.url().isPresent() && canResolveUrls()) // url has priority
+ if (isClientside() && model.url().isPresent()) // url has priority
return ModelReference.resolved(Path.of(resolveUrl(model.url().get().value()).value()));
- if (model.path().isPresent())
+ if (isClientside() && model.path().isPresent())
return ModelReference.resolved(Path.of(resolvePath(model.path().get().value()).value()));
return model;
}