From b030d222d29c98f3bb1c13a67b42887cce7ee850 Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Fri, 9 Jul 2021 11:13:27 +0200 Subject: Test whether run _should_ use tester cert, not if it already has --- .../vespa/hosted/controller/deployment/InternalStepRunner.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 3b6a03a76c9..c49e3c88df3 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 @@ -198,7 +198,7 @@ public class InternalStepRunner implements StepRunner { logger) .filter(result -> { // If no tester cert, or deployment failed, propagate original result. - if (testerCertificate.isEmpty() || result != running) + if ( ! useTesterCertificate(id) || result != running) return true; // If tester cert, ensure real is deployed with the tester cert whose key was successfully deployed. return controller.jobController().run(id).get().stepStatus(deployTester).get() == succeeded @@ -828,16 +828,20 @@ public class InternalStepRunner implements StepRunner { return deployment.at().isBefore(controller.clock().instant().minus(timeout.minus(Duration.ofMinutes(1)))); } + private boolean useTesterCertificate(RunId id) { + return controller.system().isPublic() && id.type().environment().isTest(); + } + /** Returns the application package for the tester application, assembled from a generated config, fat-jar and services.xml. */ private ApplicationPackage testerPackage(RunId id) { ApplicationVersion version = controller.jobController().run(id).get().versions().targetApplication(); DeploymentSpec spec = controller.applications().requireApplication(TenantAndApplicationId.from(id.application())).deploymentSpec(); ZoneId zone = id.type().zone(controller.system()); - boolean useTesterCertificate = controller.system().isPublic() && id.type().environment().isTest(); + boolean useTesterCertificate = useTesterCertificate(id); boolean useOsgiBasedTestRuntime = testerPlatformVersion(id).isAfter(new Version(7, 247, 11)); - byte[] servicesXml = servicesXml(! controller.system().isPublic(), + byte[] servicesXml = servicesXml( ! controller.system().isPublic(), useTesterCertificate, useOsgiBasedTestRuntime, testerResourcesFor(zone, spec.requireInstance(id.application().instance())), -- cgit v1.2.3