diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2018-11-15 12:34:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-15 12:34:12 +0100 |
commit | 733522c1b19d84020aee5b5993001b60e9381457 (patch) | |
tree | f97e38725de346862afb3c793f6ee52ee12f8b3e | |
parent | 16ca47c72d0ddd85d7dedffd19a63a526367b381 (diff) | |
parent | e5bde00ae0099cd07e116ff25e98e4150e035436 (diff) |
Merge pull request #7666 from vespa-engine/olaa/fix-ownership-confirmer
Don't add asignee for AthenzTenants
2 files changed, 6 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ApplicationOwnershipConfirmer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ApplicationOwnershipConfirmer.java index e260848d93a..2e6b3d1360d 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ApplicationOwnershipConfirmer.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ApplicationOwnershipConfirmer.java @@ -11,6 +11,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.organization.User; import com.yahoo.vespa.hosted.controller.application.ApplicationList; import com.yahoo.vespa.hosted.controller.tenant.AthenzTenant; import com.yahoo.vespa.hosted.controller.tenant.Tenant; +import com.yahoo.vespa.hosted.controller.tenant.UserTenant; import com.yahoo.yolean.Exceptions; import java.time.Duration; @@ -51,7 +52,9 @@ public class ApplicationOwnershipConfirmer extends Maintainer { try { Tenant tenant = ownerOf(application.id()); Optional<IssueId> ourIssueId = application.ownershipIssueId(); - ourIssueId = ownershipIssues.confirmOwnership(ourIssueId, application.id(), userFor(tenant), tenant.contact().orElseThrow(RuntimeException::new)); + Contact contact = tenant.contact().orElseThrow(RuntimeException::new); + User asignee = tenant instanceof UserTenant ? userFor(tenant) : null; + ourIssueId = ownershipIssues.confirmOwnership(ourIssueId, application.id(), asignee, contact); ourIssueId.ifPresent(issueId -> store(issueId, application.id())); } catch (RuntimeException e) { // Catch errors due to wrong data in the controller, or issues client timeout. 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 13733b32d86..3f5c2d1f317 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 @@ -14,6 +14,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.organization.User; import com.yahoo.vespa.hosted.controller.application.ApplicationList; import com.yahoo.vespa.hosted.controller.tenant.AthenzTenant; import com.yahoo.vespa.hosted.controller.tenant.Tenant; +import com.yahoo.vespa.hosted.controller.tenant.UserTenant; import com.yahoo.yolean.Exceptions; import java.time.Duration; @@ -117,7 +118,7 @@ public class DeploymentIssueReporter extends Maintainer { private void fileDeploymentIssueFor(ApplicationId applicationId) { try { Tenant tenant = ownerOf(applicationId); - User asignee = userFor(tenant); + User asignee = tenant instanceof UserTenant ? userFor(tenant) : null; Optional<IssueId> ourIssueId = controller().applications().require(applicationId).deploymentJobs().issueId(); IssueId issueId = deploymentIssues.fileUnlessOpen(ourIssueId, applicationId, asignee, tenant.contact().get()); store(applicationId, issueId); |