1 Star 0 Fork 2

yanyue / cloudbases.io.kiali

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gateway_checker.go 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
Hubery1003 提交于 2021-12-16 10:12 . first commit
package checkers
import (
"github.com/kiali/kiali/business/checkers/gateways"
"github.com/kiali/kiali/kubernetes"
"github.com/kiali/kiali/models"
)
const GatewayCheckerType = "gateway"
type GatewayChecker struct {
GatewaysPerNamespace [][]kubernetes.IstioObject
Namespace string
}
// Check runs checks for the all namespaces actions as well as for the single namespace validations
func (g GatewayChecker) Check() models.IstioValidations {
// Multinamespace checkers
validations := gateways.MultiMatchChecker{
GatewaysPerNamespace: g.GatewaysPerNamespace,
}.Check()
// Single namespace
for _, nssGw := range g.GatewaysPerNamespace {
for _, gw := range nssGw {
if gw.GetObjectMeta().Namespace == g.Namespace {
validations.MergeValidations(runSingleChecks(gw))
}
}
}
return validations
}
func runSingleChecks(gw kubernetes.IstioObject) models.IstioValidations {
validations := models.IstioValidations{}
checks, valid := gateways.PortChecker{
Gateway: gw,
}.Check()
if !valid {
key := models.IstioValidationKey{ObjectType: GatewayCheckerType, Name: gw.GetObjectMeta().Name}
validations[key] = &models.IstioValidation{
Name: key.Name,
ObjectType: key.ObjectType,
Checks: checks,
Valid: valid,
}
}
return validations
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/programmer-zpz/cloudbases.io.kiali.git
git@gitee.com:programmer-zpz/cloudbases.io.kiali.git
programmer-zpz
cloudbases.io.kiali
cloudbases.io.kiali
v0.15.1

搜索帮助

344bd9b3 5694891 D2dac590 5694891