diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2019-05-13 10:46:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-13 10:46:50 +0200 |
commit | 290290089b6827b3b9d4eb2ae534fafb57877188 (patch) | |
tree | 56db98d2b09c928fcc8fcb1ab94586d9436b19e9 | |
parent | 555008f9bbb282a5f620a3d4e63e757c08ed883d (diff) | |
parent | edefa944eec9dba068dfa32f20fbffe9b2b53f25 (diff) |
Merge pull request #9374 from vespa-engine/jvenstad/more-deployment/fixes
Jvenstad/more deployment/fixes
4 files changed, 9 insertions, 8 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java index f3057baaf9a..d402f150725 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java @@ -327,9 +327,10 @@ class JobControllerApiHandlerHelper { /** Returns the status of the task represented by the given step, if it has started. */ private static Optional<String> taskStatus(Step step, Run run) { - return run.readySteps().contains(step) ? Optional.of("running") - : run.steps().get(step) != unfinished ? Optional.of(run.steps().get(step).name()) - : Optional.empty(); + return run.readySteps().contains(step) ? Optional.of("running") + : Optional.ofNullable(run.steps().get(step)) + .filter(status -> status != unfinished) + .map(Step.Status::name); } /** Returns a response with the runs for the given job type. */ diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java index 278c80c48ba..eeeff2873f5 100644 --- a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java +++ b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java @@ -146,7 +146,7 @@ public abstract class ControllerHttpClient { private URI deploymentJobPath(ApplicationId id, ZoneId zone) { return concatenated(instancePath(id), - "deploy", zone.environment().value() + "-" + zone.region().value()); + "deploy", zone.environment().value() + "-" + zone.region().value().replaceAll("vaas-", "")); } private URI defaultRegionPath() { diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java index b5822ff825e..fd3409dcfcb 100644 --- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java +++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java @@ -21,7 +21,7 @@ public abstract class AbstractVespaMojo extends AbstractMojo { protected MavenProject project; @Parameter(property = "endpoint", defaultValue = "https://api.vespa.corp.yahoo.com:4443") // TODO jvenstad: Change default - protected String endpointUri; + protected String endpoint; @Parameter(property = "tenant") protected String tenant; @@ -58,8 +58,8 @@ public abstract class AbstractVespaMojo extends AbstractMojo { id = ApplicationId.from(tenant, application, instance); controller = certificateFile == null - ? ControllerHttpClient.withSignatureKey(URI.create(endpointUri), Paths.get(privateKeyFile), id) - : ControllerHttpClient.withKeyAndCertificate(URI.create(endpointUri), Paths.get(privateKeyFile), Paths.get(certificateFile)); + ? ControllerHttpClient.withSignatureKey(URI.create(endpoint), Paths.get(privateKeyFile), id) + : ControllerHttpClient.withKeyAndCertificate(URI.create(endpoint), Paths.get(privateKeyFile), Paths.get(certificateFile)); } protected String projectPathOf(String first, String... rest) { diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java index 15142a6c793..7258bd587f2 100644 --- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java +++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java @@ -48,7 +48,7 @@ public class DeployMojo extends AbstractVespaMojo { Deployment deployment = build == null ? Deployment.ofPackage(Paths.get(firstNonBlank(applicationZip, projectPathOf("target", "application.zip")))) : Deployment.ofReference(repository, branch, commit, build); - if ("true".equalsIgnoreCase(ignoreValidationErrors)) deployment = deployment.ignoringValidationErrors(); + if ("true".equalsIgnoreCase(ignoreValidationErrors)) deployment = deployment.ignoringValidationErrors(); // TODO unused, GC or fix. if (vespaVersion != null) deployment = deployment.atVersion(vespaVersion); ZoneId zone = environment == null || region == null ? controller.devZone() : ZoneId.from(environment, region); |