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

Method getSubDomainPods

server/controller/cloud/sub_domain.go:670–702  ·  view source on GitHub ↗
(
	subDomainLcuuid, azLcuuid string, resource *kubernetes_model.KubernetesGatherResource, nodeLcuuidToAZLcuuid map[string]string,
)

Source from the content-addressed store, hash-verified

668}
669
670func (c *Cloud) getSubDomainPods(
671 subDomainLcuuid, azLcuuid string, resource *kubernetes_model.KubernetesGatherResource, nodeLcuuidToAZLcuuid map[string]string,
672) []model.Pod {
673 var retPods []model.Pod
674
675 // 遍历Pods,更新az信息;并添加到Cloud的Resource中
676 for _, pod := range resource.Pods {
677 podAZLcuuid, ok := nodeLcuuidToAZLcuuid[pod.PodNodeLcuuid]
678 if !ok || podAZLcuuid == "" {
679 podAZLcuuid = azLcuuid
680 }
681 retPods = append(retPods, model.Pod{
682 Lcuuid: pod.Lcuuid,
683 Name: pod.Name,
684 Annotation: pod.Annotation,
685 ENV: pod.ENV,
686 Label: pod.Label,
687 ContainerIDs: pod.ContainerIDs,
688 State: pod.State,
689 CreatedAt: pod.CreatedAt,
690 PodReplicaSetLcuuid: pod.PodReplicaSetLcuuid,
691 PodNodeLcuuid: pod.PodNodeLcuuid,
692 PodGroupLcuuid: pod.PodGroupLcuuid,
693 PodNamespaceLcuuid: pod.PodNamespaceLcuuid,
694 PodClusterLcuuid: pod.PodClusterLcuuid,
695 VPCLcuuid: pod.VPCLcuuid,
696 AZLcuuid: podAZLcuuid,
697 RegionLcuuid: pod.RegionLcuuid,
698 SubDomainLcuuid: subDomainLcuuid,
699 })
700 }
701 return retPods
702}
703
704func (c *Cloud) getSubDomainIPs(subDomainLcuuid string, cResource model.Resource, kResource *kubernetes_model.KubernetesGatherResource, existNodeIPs map[string]bool) ([]model.IP, map[string]int, map[string]string) {
705 var retIPs []model.IP

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected