MCPcopy Create free account
hub / github.com/deepflowio/deepflow / getSubDomainIngresses

Method getSubDomainIngresses

server/controller/cloud/sub_domain.go:510–551  ·  view source on GitHub ↗
(
	subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource, azLcuuid string,
)

Source from the content-addressed store, hash-verified

508}
509
510func (c *Cloud) getSubDomainIngresses(
511 subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource, azLcuuid string,
512) ([]model.PodIngress, []model.PodIngressRule, []model.PodIngressRuleBackend) {
513 var retPodIngresses []model.PodIngress
514 var retPodIngressRules []model.PodIngressRule
515 var retPodIngressRuleBackends []model.PodIngressRuleBackend
516
517 // 遍历PodIngresses,更新az信息;并添加到Cloud的Resource中
518 for _, podIngress := range resource.PodIngresses {
519 retPodIngresses = append(retPodIngresses, model.PodIngress{
520 Lcuuid: podIngress.Lcuuid,
521 Name: podIngress.Name,
522 PodNamespaceLcuuid: podIngress.PodNamespaceLcuuid,
523 PodClusterLcuuid: podIngress.PodClusterLcuuid,
524 AZLcuuid: azLcuuid,
525 RegionLcuuid: podIngress.RegionLcuuid,
526 SubDomainLcuuid: subDomainLcuuid,
527 })
528 }
529 for _, podIngressRule := range resource.PodIngressRules {
530 retPodIngressRules = append(retPodIngressRules, model.PodIngressRule{
531 Lcuuid: podIngressRule.Lcuuid,
532 Name: podIngressRule.Name,
533 Protocol: podIngressRule.Protocol,
534 Host: podIngressRule.Host,
535 PodIngressLcuuid: podIngressRule.PodIngressLcuuid,
536 SubDomainLcuuid: subDomainLcuuid,
537 })
538 }
539 for _, podIngressRuleBackend := range resource.PodIngressRuleBackends {
540 retPodIngressRuleBackends = append(retPodIngressRuleBackends, model.PodIngressRuleBackend{
541 Lcuuid: podIngressRuleBackend.Lcuuid,
542 Path: podIngressRuleBackend.Path,
543 Port: podIngressRuleBackend.Port,
544 PodServiceLcuuid: podIngressRuleBackend.PodServiceLcuuid,
545 PodIngressLcuuid: podIngressRuleBackend.PodIngressLcuuid,
546 PodIngressRuleLcuuid: podIngressRuleBackend.PodIngressRuleLcuuid,
547 SubDomainLcuuid: subDomainLcuuid,
548 })
549 }
550 return retPodIngresses, retPodIngressRules, retPodIngressRuleBackends
551}
552
553func (c *Cloud) getSubDomainPodServices(
554 subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource, azLcuuid string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected