Add Tenant Deletion Date to tenant responses (#270)

This commit is contained in:
Daniel Valdivia
2020-09-05 23:37:01 -07:00
committed by GitHub
parent 3b23e877b5
commit adf3f929a4
6 changed files with 33 additions and 113 deletions

View File

@@ -266,9 +266,14 @@ func getTenantInfo(tenant *operator.Tenant) *models.Tenant {
zoneSize := int64(z.Servers) * int64(z.VolumesPerServer) * z.VolumeClaimTemplate.Spec.Resources.Requests.Storage().Value()
totalSize = totalSize + zoneSize
}
var deletion string
if tenant.ObjectMeta.DeletionTimestamp != nil {
deletion = tenant.ObjectMeta.DeletionTimestamp.String()
}
return &models.Tenant{
CreationDate: tenant.ObjectMeta.CreationTimestamp.String(),
DeletionDate: deletion,
Name: tenant.Name,
TotalSize: totalSize,
CurrentState: tenant.Status.CurrentState,
@@ -330,8 +335,14 @@ func listTenants(ctx context.Context, operatorClient OperatorClientI, namespace
}
}
var deletion string
if tenant.ObjectMeta.DeletionTimestamp != nil {
deletion = tenant.ObjectMeta.DeletionTimestamp.String()
}
tenants = append(tenants, &models.TenantList{
CreationDate: tenant.ObjectMeta.CreationTimestamp.String(),
DeletionDate: deletion,
Name: tenant.ObjectMeta.Name,
ZoneCount: int64(len(tenant.Spec.Zones)),
InstanceCount: instanceCount,

View File

@@ -3156,6 +3156,9 @@ func init() {
"currentState": {
"type": "string"
},
"deletion_date": {
"type": "string"
},
"image": {
"type": "string"
},
@@ -3186,6 +3189,9 @@ func init() {
"currentState": {
"type": "string"
},
"deletion_date": {
"type": "string"
},
"instance_count": {
"type": "integer"
},
@@ -7231,6 +7237,9 @@ func init() {
"currentState": {
"type": "string"
},
"deletion_date": {
"type": "string"
},
"image": {
"type": "string"
},
@@ -7261,6 +7270,9 @@ func init() {
"currentState": {
"type": "string"
},
"deletion_date": {
"type": "string"
},
"instance_count": {
"type": "integer"
},