Added domains item in create tenant & get tenant requests (#1841)
This commit is contained in:
@@ -2000,6 +2000,10 @@ func init() {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"domains": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/domainsConfiguration"
|
||||
},
|
||||
"enable_console": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
@@ -2158,6 +2162,20 @@ func init() {
|
||||
}
|
||||
}
|
||||
},
|
||||
"domainsConfiguration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"console": {
|
||||
"type": "string"
|
||||
},
|
||||
"minio": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"encryptionConfiguration": {
|
||||
"allOf": [
|
||||
{
|
||||
@@ -3430,6 +3448,9 @@ func init() {
|
||||
"deletion_date": {
|
||||
"type": "string"
|
||||
},
|
||||
"domains": {
|
||||
"$ref": "#/definitions/domainsConfiguration"
|
||||
},
|
||||
"enable_prometheus": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -3517,6 +3538,10 @@ func init() {
|
||||
"deletion_date": {
|
||||
"type": "string"
|
||||
},
|
||||
"domains": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/domainsConfiguration"
|
||||
},
|
||||
"health_status": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -6837,6 +6862,10 @@ func init() {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"domains": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/domainsConfiguration"
|
||||
},
|
||||
"enable_console": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
@@ -6995,6 +7024,20 @@ func init() {
|
||||
}
|
||||
}
|
||||
},
|
||||
"domainsConfiguration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"console": {
|
||||
"type": "string"
|
||||
},
|
||||
"minio": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"encryptionConfiguration": {
|
||||
"allOf": [
|
||||
{
|
||||
@@ -8120,6 +8163,9 @@ func init() {
|
||||
"deletion_date": {
|
||||
"type": "string"
|
||||
},
|
||||
"domains": {
|
||||
"$ref": "#/definitions/domainsConfiguration"
|
||||
},
|
||||
"enable_prometheus": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -8207,6 +8253,10 @@ func init() {
|
||||
"deletion_date": {
|
||||
"type": "string"
|
||||
},
|
||||
"domains": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/domainsConfiguration"
|
||||
},
|
||||
"health_status": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -430,6 +430,7 @@ func getTenantCreatedResponse(session *models.Principal, params operator_api.Cre
|
||||
if (diskSpaceFromAPI / humanize.GiByte) < int64(auditMaxCap) {
|
||||
auditMaxCap = int(diskSpaceFromAPI / humanize.GiByte)
|
||||
}
|
||||
|
||||
// default activate lgo search and prometheus
|
||||
minInst.Spec.Log = &miniov2.LogConfig{
|
||||
Audit: &miniov2.AuditConfig{DiskCapacityGB: swag.Int(auditMaxCap)},
|
||||
@@ -541,6 +542,24 @@ func getTenantCreatedResponse(session *models.Principal, params operator_api.Cre
|
||||
}
|
||||
minInst.Spec.Configuration = &corev1.LocalObjectReference{Name: tenantConfigurationName}
|
||||
|
||||
if tenantReq.Domains != nil {
|
||||
var features miniov2.Features
|
||||
var domains miniov2.TenantDomains
|
||||
|
||||
// tenant domains
|
||||
if tenantReq.Domains.Console != "" {
|
||||
domains.Console = tenantReq.Domains.Console
|
||||
}
|
||||
|
||||
if tenantReq.Domains.Minio != nil {
|
||||
domains.Minio = tenantReq.Domains.Minio
|
||||
}
|
||||
|
||||
features.Domains = &domains
|
||||
|
||||
minInst.Spec.Features = &features
|
||||
}
|
||||
|
||||
opClient, err := cluster.OperatorClient(session.STSSessionToken)
|
||||
if err != nil {
|
||||
return nil, prepareError(err)
|
||||
|
||||
@@ -150,5 +150,16 @@ func getTenantDetailsResponse(session *models.Principal, params operator_api.Ten
|
||||
}
|
||||
}
|
||||
|
||||
var domains models.DomainsConfiguration
|
||||
|
||||
if minTenant.Spec.Features != nil && minTenant.Spec.Features.Domains != nil {
|
||||
domains = models.DomainsConfiguration{
|
||||
Console: minTenant.Spec.Features.Domains.Console,
|
||||
Minio: minTenant.Spec.Features.Domains.Minio,
|
||||
}
|
||||
}
|
||||
|
||||
info.Domains = &domains
|
||||
|
||||
return info, nil
|
||||
}
|
||||
|
||||
@@ -1073,6 +1073,15 @@ func listTenants(ctx context.Context, operatorClient OperatorClientI, namespace
|
||||
tiers = append(tiers, tierItem)
|
||||
}
|
||||
|
||||
var domains models.DomainsConfiguration
|
||||
|
||||
if tenant.Spec.Features != nil && tenant.Spec.Features.Domains != nil {
|
||||
domains = models.DomainsConfiguration{
|
||||
Console: tenant.Spec.Features.Domains.Console,
|
||||
Minio: tenant.Spec.Features.Domains.Minio,
|
||||
}
|
||||
}
|
||||
|
||||
tenants = append(tenants, &models.TenantList{
|
||||
CreationDate: tenant.ObjectMeta.CreationTimestamp.Format(time.RFC3339),
|
||||
DeletionDate: deletion,
|
||||
@@ -1089,6 +1098,7 @@ func listTenants(ctx context.Context, operatorClient OperatorClientI, namespace
|
||||
Capacity: tenant.Status.Usage.Capacity,
|
||||
CapacityUsage: tenant.Status.Usage.Usage,
|
||||
Tiers: tiers,
|
||||
Domains: &domains,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user