aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2020-08-05 15:02:35 +0200
committerØyvind Grønnesby <oyving@verizonmedia.com>2020-08-05 15:02:35 +0200
commit110d2ddfe12ee3c9a1a312f8cab727c956b881c1 (patch)
treeab0a37e33dba5b20f23e98fbfbc6303feacba9d3 /controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
parent75b7675c38fddf27daf17bcb46fc575d8dc8049e (diff)
Stop reading BillingInfo but write the default value
Preparing to completely remove BillingInfo as it was never used. First step is to stop reading it. Once that has propagated we can remove the class completely.
Diffstat (limited to 'controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
index d4d5f4deb7b..5e9d5c44d4c 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
@@ -84,8 +84,12 @@ public class TenantSerializer {
}
private void toSlime(CloudTenant tenant, Cursor root) {
+ // BillingInfo was never used and always just a static default value. To retire this
+ // field we continue to write the default value and stop reading it.
+ // TODO(ogronnesby, 2020-08-05): Remove when a version where we do not read the field has propagated.
+ var legacyBillingInfo = new BillingInfo("customer", "Vespa");
developerKeysToSlime(tenant.developerKeys(), root.setArray(pemDeveloperKeysField));
- toSlime(tenant.billingInfo(), root.setObject(billingInfoField));
+ toSlime(legacyBillingInfo, root.setObject(billingInfoField));
}
private void developerKeysToSlime(BiMap<PublicKey, Principal> keys, Cursor array) {
@@ -124,9 +128,8 @@ public class TenantSerializer {
private CloudTenant cloudTenantFrom(Inspector tenantObject) {
TenantName name = TenantName.from(tenantObject.field(nameField).asString());
- BillingInfo billingInfo = billingInfoFrom(tenantObject.field(billingInfoField));
BiMap<PublicKey, Principal> developerKeys = developerKeysFromSlime(tenantObject.field(pemDeveloperKeysField));
- return new CloudTenant(name, billingInfo, developerKeys);
+ return new CloudTenant(name, developerKeys);
}
private BiMap<PublicKey, Principal> developerKeysFromSlime(Inspector array) {