From 0861faaf480fbbd185d650e6bcf8122d88d3c8de Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Mon, 11 Nov 2019 12:58:02 +0100 Subject: Always try to build config model for old versions Try to build old config models, but do not fail deployment if skip-old-config-models validation override is true and building an old model fails. In manually deployed zones we previously did not build old config models, since skip-old-config-models was always true. With this change we will try to build those old models, but not fail if building one or more old models fails. --- .../main/java/com/yahoo/vespa/model/VespaModelFactory.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'config-model') diff --git a/config-model/src/main/java/com/yahoo/vespa/model/VespaModelFactory.java b/config-model/src/main/java/com/yahoo/vespa/model/VespaModelFactory.java index 1dc0b838470..54807697da4 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/VespaModelFactory.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/VespaModelFactory.java @@ -66,14 +66,20 @@ public class VespaModelFactory implements ModelFactory { this.clock = Clock.systemUTC(); } - + + // For testing only public VespaModelFactory(ConfigModelRegistry configModelRegistry) { this(configModelRegistry, Clock.systemUTC()); } + + // For testing only public VespaModelFactory(ConfigModelRegistry configModelRegistry, Clock clock) { - this(new Version(VespaVersion.major, VespaVersion.minor, VespaVersion.micro), configModelRegistry, clock); + this(new Version(VespaVersion.major, VespaVersion.minor, VespaVersion.micro), configModelRegistry, + clock, Zone.defaultZone()); } - public VespaModelFactory(Version version, ConfigModelRegistry configModelRegistry, Clock clock) { + + // For testing only + public VespaModelFactory(Version version, ConfigModelRegistry configModelRegistry, Clock clock, Zone zone) { this.version = version; if (configModelRegistry == null) { this.configModelRegistry = new NullConfigModelRegistry(); @@ -82,7 +88,7 @@ public class VespaModelFactory implements ModelFactory { this.configModelRegistry = configModelRegistry; } this.modelImporters = Collections.emptyList(); - this.zone = Zone.defaultZone(); + this.zone = zone; this.clock = clock; } -- cgit v1.2.3