aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorn.christian@seime.no>2023-10-17 12:31:27 +0200
committerGitHub <noreply@github.com>2023-10-17 12:31:27 +0200
commit98d46e68bb4c8f1ca461974a43a87eb73d4a59fd (patch)
treee666e3c6388d4a7dcf8e30f178d9cfabd9833216 /controller-api/src/main/java/com/yahoo
parentd2d8defecb78b03f2332fee7a255512fbef8087b (diff)
Revert "Revert "Set creator as contact when initiating new tenant""
Diffstat (limited to 'controller-api/src/main/java/com/yahoo')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java
index 4a61ff30c25..9ceeba32061 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java
@@ -51,11 +51,16 @@ public class CloudTenant extends Tenant {
/** Creates a tenant with the given name, provided it passes validation. */
public static CloudTenant create(TenantName tenantName, Instant createdAt, Principal creator) {
+ // Initialize with creator as verified contact
+ var info = TenantInfo.empty().withContacts(new TenantContacts(List.of(
+ new TenantContacts.EmailContact(
+ List.of(TenantContacts.Audience.TENANT, TenantContacts.Audience.NOTIFICATIONS),
+ new Email(creator.getName(), true)))));
return new CloudTenant(requireName(tenantName),
createdAt,
LastLoginInfo.EMPTY,
Optional.ofNullable(creator).map(SimplePrincipal::of),
- ImmutableBiMap.of(), TenantInfo.empty(), List.of(), new ArchiveAccess(), Optional.empty(),
+ ImmutableBiMap.of(), info, List.of(), new ArchiveAccess(), Optional.empty(),
Instant.EPOCH, List.of(), Optional.empty(), PlanId.from("none"));
}