You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

32 lines
681 B

package service
import (
"context"
"strings"
"go-common/app/admin/ep/merlin/model"
)
// QueryCluster query cluster.
func (s *Service) QueryCluster(c context.Context) (clusters []*model.Cluster, err error) {
var tmpClusters []*model.Cluster
if tmpClusters, err = s.dao.QueryClusters(c); err != nil {
return
}
for _, tmpCluster := range tmpClusters {
if !strings.Contains(tmpCluster.Name, "uat") {
clusters = append(clusters, tmpCluster)
}
}
for _, cluster := range clusters {
for _, supportName := range s.c.BiliHub.SupportNetWork {
if strings.Contains(cluster.Name, supportName) {
cluster.IsSupportSnapShot = true
continue
}
}
}
return
}