Fix Tenant Details Bugs (#589)

This fixes #584 by making the expand set a name for the pool
This fixes #585 by making the expand set an affinity for the pool
This fixes #586 by generating a pool name if it's not indicated only
This commit is contained in:
Daniel Valdivia
2021-02-05 14:27:29 -08:00
committed by GitHub
parent 7174892231
commit 1dcdc61ce8
11 changed files with 250 additions and 146 deletions

View File

@@ -381,12 +381,14 @@ func getTenantInfoResponse(session *models.Principal, params admin_api.TenantInf
//minio service
minSvc, err := k8sClient.getService(ctx, minTenant.Namespace, minTenant.MinIOCIServiceName(), metav1.GetOptions{})
if err != nil {
return nil, prepareError(err)
// we can tolerate this error
log.Println(err)
}
//console service
conSvc, err := k8sClient.getService(ctx, minTenant.Namespace, minTenant.ConsoleCIServiceName(), metav1.GetOptions{})
if err != nil {
return nil, prepareError(err)
// we can tolerate this error
log.Println(err)
}
schema := "http"
@@ -401,10 +403,10 @@ func getTenantInfoResponse(session *models.Principal, params admin_api.TenantInf
}
var minioEndpoint string
var consoleEndpoint string
if len(minSvc.Status.LoadBalancer.Ingress) > 0 {
if minSvc != nil && len(minSvc.Status.LoadBalancer.Ingress) > 0 {
minioEndpoint = fmt.Sprintf("%s://%s", schema, minSvc.Status.LoadBalancer.Ingress[0].IP)
}
if len(conSvc.Status.LoadBalancer.Ingress) > 0 {
if conSvc != nil && len(conSvc.Status.LoadBalancer.Ingress) > 0 {
consoleEndpoint = fmt.Sprintf("%s://%s%s", consoleSchema, conSvc.Status.LoadBalancer.Ingress[0].IP, consolePort)
}
if minioEndpoint != "" || consoleEndpoint != "" {