summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2019-01-23 09:47:11 +0100
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2019-01-23 09:47:11 +0100
commit6e178b644d0c786783e8e76f1b57a17999eaab18 (patch)
tree475978b6bf77952cb0808e199c340e01832bd84d
parent65f9fad6f9255e693d3537620bbaac4d2443f9a3 (diff)
Use major from deployment.xml when deploying to dev/perf
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java6
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
index da0f7750995..4a8670b9f9e 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
@@ -280,9 +280,9 @@ public class ApplicationController {
ApplicationVersion applicationVersion;
ApplicationPackage applicationPackage;
if (canDeployDirectly) {
- platformVersion = options.vespaVersion.map(Version::new).orElse(curator.readTargetMajorVersion()
- .flatMap(this::lastCompatibleVersion)
- .orElse(controller.systemVersion()));
+ platformVersion = options.vespaVersion.map(Version::new).orElse(application.get().deploymentSpec().majorVersion()
+ .flatMap(this::lastCompatibleVersion)
+ .orElse(controller.systemVersion()));
applicationVersion = applicationVersionFromDeployer.orElse(ApplicationVersion.unknown);
applicationPackage = applicationPackageFromDeployer.orElseThrow(
() -> new IllegalArgumentException("Application package must be given when deploying to " + zone));
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java
index 66aa35782f0..343deaec752 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java
@@ -452,6 +452,7 @@ public class ControllerTest {
tester.controllerTester().zoneRegistry().setZones(ZoneId.from("prod", "cd-us-central-1"));
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
.environment(Environment.prod)
+ .majorVersion(6)
.region("cd-us-central-1")
.build();
@@ -472,7 +473,6 @@ public class ControllerTest {
tester.applications().require(app.id()).deploymentJobs().jobStatus().isEmpty());
Version seven = Version.fromString("7.2");
- tester.upgrader().setTargetMajorVersion(Optional.of(6));
tester.upgradeSystem(seven);
tester.controller().applications().deploy(app.id(), zone, Optional.of(applicationPackage), options);
assertEquals(six, tester.application(app.id()).deployments().get(zone).version());