summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-11-18 15:18:28 +0100
committerJon Marius Venstad <venstad@gmail.com>2019-11-18 15:18:28 +0100
commit1b48edd8052f1906b2e2c88ef0b9ada4d0602513 (patch)
treec8f90bf044e3109d7e0528b053c72d5fc77a5777 /controller-server
parent24be87327ebbff702d113084b0ef87fd194c0ef4 (diff)
Use application owner as assignee, if present
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporter.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporter.java
index f139001aa28..930a0f257f9 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporter.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporter.java
@@ -71,7 +71,7 @@ public class DeploymentIssueReporter extends Maintainer {
for (Application application : applications)
if (failingApplications.contains(application.id()))
- fileDeploymentIssueFor(application.id());
+ fileDeploymentIssueFor(application);
else
store(application.id(), null);
}
@@ -116,18 +116,18 @@ public class DeploymentIssueReporter extends Maintainer {
}
/** File an issue for applicationId, if it doesn't already have an open issue associated with it. */
- private void fileDeploymentIssueFor(TenantAndApplicationId applicationId) {
+ private void fileDeploymentIssueFor(Application application) {
try {
- Tenant tenant = ownerOf(applicationId);
+ Tenant tenant = ownerOf(application.id());
tenant.contact().ifPresent(contact -> {
- User assignee = tenant.type() == Tenant.Type.user ? userFor(tenant) : null;
- Optional<IssueId> ourIssueId = controller().applications().requireApplication(applicationId).deploymentIssueId();
- IssueId issueId = deploymentIssues.fileUnlessOpen(ourIssueId, applicationId.defaultInstance(), assignee, contact);
- store(applicationId, issueId);
+ User assignee = tenant.type() == Tenant.Type.user ? userFor(tenant) : application.owner().orElse(null);
+ Optional<IssueId> ourIssueId = application.deploymentIssueId();
+ IssueId issueId = deploymentIssues.fileUnlessOpen(ourIssueId, application.id().defaultInstance(), assignee, contact);
+ store(application.id(), issueId);
});
}
catch (RuntimeException e) { // Catch errors due to wrong data in the controller, or issues client timeout.
- log.log(Level.INFO, "Exception caught when attempting to file an issue for '" + applicationId + "': " + Exceptions.toMessageString(e));
+ log.log(Level.INFO, "Exception caught when attempting to file an issue for '" + application.id() + "': " + Exceptions.toMessageString(e));
}
}