Add features box to tenant details (#738)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2021-05-14 15:04:29 -07:00
committed by GitHub
parent 9c5a788dae
commit 2769ba145a
22 changed files with 688 additions and 372 deletions

View File

@@ -381,6 +381,15 @@ func getTenantInfoResponse(session *models.Principal, params admin_api.TenantInf
info := getTenantInfo(minTenant)
// detect if AD is enabled
adEnabled := false
for _, env := range minTenant.Spec.Env {
if env.Name == "MINIO_IDENTITY_LDAP_SERVER_ADDR" && env.Value != "" {
adEnabled = true
}
}
// get Kubernetes Client
clientSet, err := cluster.K8sClient(session.STSSessionToken)
if err != nil {
return nil, prepareError(err)
@@ -390,6 +399,26 @@ func getTenantInfoResponse(session *models.Principal, params admin_api.TenantInf
client: clientSet,
}
// detect if OpenID is enabled
oicEnabled := false
consoleSecret, err := clientSet.CoreV1().Secrets(minTenant.Namespace).Get(ctx, minTenant.Name, metav1.GetOptions{})
// we can tolerate not getting this secret
if err != nil {
log.Println(err)
}
if consoleSecret != nil {
if _, ok := consoleSecret.Data["CONSOLE_IDP_URL"]; ok {
oicEnabled = true
}
}
info.LogEnabled = minTenant.HasLogEnabled()
info.MonitoringEnabled = minTenant.HasPrometheusEnabled()
info.EncryptionEnabled = minTenant.HasKESEnabled()
info.IdpAdEnabled = adEnabled
info.IdpOicEnabled = oicEnabled
if minTenant.Spec.Console != nil {
// obtain current subnet license for tenant (if exists)
license, _ := getSubscriptionLicense(context.Background(), &k8sClient, params.Namespace, minTenant.Spec.Console.ConsoleSecret.Name)

View File

@@ -6442,6 +6442,9 @@ func init() {
"enable_prometheus": {
"type": "boolean"
},
"encryptionEnabled": {
"type": "boolean"
},
"endpoints": {
"type": "object",
"properties": {
@@ -6453,9 +6456,21 @@ func init() {
}
}
},
"idpAdEnabled": {
"type": "boolean"
},
"idpOicEnabled": {
"type": "boolean"
},
"image": {
"type": "string"
},
"logEnabled": {
"type": "boolean"
},
"monitoringEnabled": {
"type": "boolean"
},
"name": {
"type": "string"
},
@@ -13842,6 +13857,9 @@ func init() {
"enable_prometheus": {
"type": "boolean"
},
"encryptionEnabled": {
"type": "boolean"
},
"endpoints": {
"type": "object",
"properties": {
@@ -13853,9 +13871,21 @@ func init() {
}
}
},
"idpAdEnabled": {
"type": "boolean"
},
"idpOicEnabled": {
"type": "boolean"
},
"image": {
"type": "string"
},
"logEnabled": {
"type": "boolean"
},
"monitoringEnabled": {
"type": "boolean"
},
"name": {
"type": "string"
},