diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2020-05-26 21:25:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 21:25:39 +0200 |
commit | 47af512cba6b882ea46168f248efbdd6dee0d150 (patch) | |
tree | 111f005b0b00dcaa68b2f5e882439ba1fa038b69 | |
parent | 346da800298aa99558dd0cfea9886eb560039c48 (diff) | |
parent | 264f5e1384b997a76aabd78e793872cf0e05009a (diff) |
Merge pull request #13383 from vespa-engine/jonmv/use-tester-on-pinned-version-when-pinned
Use target platform for testers when application is pinned
2 files changed, 11 insertions, 10 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 3e3a25dac80..f08cce57dcb 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -194,12 +194,7 @@ public class InternalStepRunner implements StepRunner { } private Optional<RunStatus> deployTester(RunId id, DualLogger logger) { - Version targetPlatform = controller.jobController().run(id).get().versions().targetPlatform(); - // TODO: Hack to make sure some pinned applications get this version for tester deployments - // Remove when no applications are pinned to this version anymore - final Version platform = targetPlatform.equals(Version.fromString("7.220.14")) - ? targetPlatform - : controller.systemVersion(); + Version platform = testerPlatformVersion(id); logger.log("Deploying the tester container on platform " + platform + " ..."); return deploy(id.tester().id(), id.type(), @@ -414,9 +409,15 @@ public class InternalStepRunner implements StepRunner { return Optional.empty(); } + private Version testerPlatformVersion(RunId id) { + return application(id.application()).change().isPinned() + ? controller.jobController().run(id).get().versions().targetPlatform() + : controller.systemVersion(); + } + private Optional<RunStatus> installTester(RunId id, DualLogger logger) { Run run = controller.jobController().run(id).get(); - Version platform = controller.systemVersion(); + Version platform = testerPlatformVersion(id); ZoneId zone = id.type().zone(controller.system()); ApplicationId testerId = id.tester().id(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java index dd2267be3a4..acb8cf1a2a9 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java @@ -447,7 +447,7 @@ public class DeploymentContext { if (job.type() == JobType.stagingTest) { // Do the initial deployment and installation of the real application. assertEquals(unfinished, jobs.run(id).get().stepStatuses().get(Step.installInitialReal)); Versions versions = currentRun(job).versions(); - tester.configServer().nodeRepository().doUpgrade(deployment, Optional.empty(), versions.sourcePlatform().orElse(versions.targetPlatform())); + tester.configServer().nodeRepository().doUpgrade(deployment, Optional.empty(), tester.configServer().application(job.application(), zone).get().version().get()); configServer().convergeServices(id.application(), zone); runner.advance(currentRun(job)); assertEquals(Step.Status.succeeded, jobs.run(id).get().stepStatuses().get(Step.installInitialReal)); @@ -471,7 +471,7 @@ public class DeploymentContext { DeploymentId deployment = new DeploymentId(job.application(), zone); assertEquals(unfinished, jobs.run(id).get().stepStatuses().get(Step.installReal)); - configServer().nodeRepository().doUpgrade(deployment, Optional.empty(), currentRun(job).versions().targetPlatform()); + configServer().nodeRepository().doUpgrade(deployment, Optional.empty(), tester.configServer().application(job.application(), zone).get().version().get()); runner.advance(currentRun(job)); } @@ -507,7 +507,7 @@ public class DeploymentContext { ZoneId zone = zone(job); assertEquals(unfinished, jobs.run(id).get().stepStatuses().get(Step.installTester)); - configServer().nodeRepository().doUpgrade(new DeploymentId(TesterId.of(job.application()).id(), zone), Optional.empty(), tester.controller().systemVersion()); + configServer().nodeRepository().doUpgrade(new DeploymentId(TesterId.of(job.application()).id(), zone), Optional.empty(), tester.configServer().application(id.tester().id(), zone).get().version().get()); runner.advance(currentRun(job)); assertEquals(unfinished, jobs.run(id).get().stepStatuses().get(Step.installTester)); configServer().convergeServices(TesterId.of(id.application()).id(), zone); |