From db4d7f0f9102c15def5c2ff5aee6378213c409bd Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Mon, 23 Jan 2023 17:39:35 +0100 Subject: Pass DeployState - no functional changes --- .../com/yahoo/config/model/deploy/DeployState.java | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'config-model/src/main/java/com/yahoo/config/model') diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java index 54521b946dd..1813e183a60 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java @@ -122,7 +122,8 @@ public class DeployState implements ConfigDefinitionStore { Version wantedNodeVespaVersion, boolean accessLoggingEnabledByDefault, Optional wantedDockerImageRepo, - Reindexing reindexing) { + Reindexing reindexing, + Optional validationOverrides) { this.logger = deployLogger; this.fileRegistry = fileRegistry; this.executor = executor; @@ -143,8 +144,8 @@ public class DeployState implements ConfigDefinitionStore { this.semanticRules = semanticRules; // TODO: Remove this by seeing how pagetemplates are propagated this.importedModels = importMlModels(applicationPackage, modelImporters, executor); - this.validationOverrides = applicationPackage.getValidationOverrides().map(ValidationOverrides::fromXml) - .orElse(ValidationOverrides.empty); + this.validationOverrides = validationOverrides.orElse(applicationPackage.getValidationOverrides().map(ValidationOverrides::fromXml) + .orElse(ValidationOverrides.empty)); this.wantedNodeVespaVersion = wantedNodeVespaVersion; this.now = now; @@ -327,9 +328,10 @@ public class DeployState implements ConfigDefinitionStore { private Version wantedNodeVespaVersion = Vtag.currentVersion; private boolean accessLoggingEnabledByDefault = true; private Optional wantedDockerImageRepo = Optional.empty(); - private Reindexing reindexing = null; private RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); private QueryProfiles queryProfiles = null; + private Reindexing reindexing = null; + private Optional validationOverrides = Optional.empty(); public Builder() {} @@ -437,7 +439,15 @@ public class DeployState implements ConfigDefinitionStore { return this; } - public Builder reindexing(Reindexing reindexing) { this.reindexing = Objects.requireNonNull(reindexing); return this; } + public Builder reindexing(Reindexing reindexing) { + this.reindexing = Objects.requireNonNull(reindexing); + return this; + } + + public Builder validationOverrides(ValidationOverrides validationOverrides) { + this.validationOverrides = Optional.of(validationOverrides); + return this; + } public DeployState build() { return build(new ValidationParameters()); @@ -470,7 +480,8 @@ public class DeployState implements ConfigDefinitionStore { wantedNodeVespaVersion, accessLoggingEnabledByDefault, wantedDockerImageRepo, - reindexing); + reindexing, + validationOverrides); } } -- cgit v1.2.3