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

Method getSubDomainSubnets

server/controller/cloud/sub_domain.go:830–870  ·  view source on GitHub ↗
(
	subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource,
	reservedPodSubnetLcuuidToIPNum map[string]int,
)

Source from the content-addressed store, hash-verified

828}
829
830func (c *Cloud) getSubDomainSubnets(
831 subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource,
832 reservedPodSubnetLcuuidToIPNum map[string]int,
833) []model.Subnet {
834 var retSubnets []model.Subnet
835
836 // POD/Service子网无需处理,直接补充subDomainLcuuid
837 for _, subnets := range [][]model.Subnet{
838 resource.PodSubnets, resource.PodServiceSubnets,
839 } {
840 for _, subnet := range subnets {
841 retSubnets = append(retSubnets, model.Subnet{
842 Lcuuid: subnet.Lcuuid,
843 Name: subnet.Name,
844 Label: subnet.Label,
845 CIDR: subnet.CIDR,
846 NetworkLcuuid: subnet.NetworkLcuuid,
847 VPCLcuuid: subnet.VPCLcuuid,
848 SubDomainLcuuid: subDomainLcuuid,
849 })
850 }
851 }
852
853 // 容器节点子网需要检查是否在保留子网中,如果在则补充subDomainLcuuid;否则跳过
854 for _, subnet := range resource.PodNodeSubnets {
855 if _, ok := reservedPodSubnetLcuuidToIPNum[subnet.Lcuuid]; !ok {
856 continue
857 }
858 retSubnets = append(retSubnets, model.Subnet{
859 Lcuuid: subnet.Lcuuid,
860 Name: subnet.Name,
861 Label: subnet.Label,
862 CIDR: subnet.CIDR,
863 NetworkLcuuid: subnet.NetworkLcuuid,
864 VPCLcuuid: subnet.VPCLcuuid,
865 SubDomainLcuuid: subDomainLcuuid,
866 })
867 }
868
869 return retSubnets
870}
871
872func (c *Cloud) getSubDomainNetworks(
873 subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource, azLcuuid string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected