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

Method getSubDomainPodServices

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

Source from the content-addressed store, hash-verified

551}
552
553func (c *Cloud) getSubDomainPodServices(
554 subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource, azLcuuid string,
555) ([]model.PodService, []model.PodServicePort) {
556 var retPodServices []model.PodService
557 var retPodServicePorts []model.PodServicePort
558
559 // 遍历PodServices,更新az信息;并添加到Cloud的Resource中
560 for _, podService := range resource.PodServices {
561 retPodServices = append(retPodServices, model.PodService{
562 Lcuuid: podService.Lcuuid,
563 Name: podService.Name,
564 Metadata: podService.Metadata,
565 MetadataHash: podService.MetadataHash,
566 Spec: podService.Spec,
567 SpecHash: podService.SpecHash,
568 Label: podService.Label,
569 Annotation: podService.Annotation,
570 Type: podService.Type,
571 Selector: podService.Selector,
572 ExternalIP: podService.ExternalIP,
573 ServiceClusterIP: podService.ServiceClusterIP,
574 PodIngressLcuuid: podService.PodIngressLcuuid,
575 PodNamespaceLcuuid: podService.PodNamespaceLcuuid,
576 PodClusterLcuuid: podService.PodClusterLcuuid,
577 VPCLcuuid: podService.VPCLcuuid,
578 AZLcuuid: azLcuuid,
579 RegionLcuuid: podService.RegionLcuuid,
580 SubDomainLcuuid: subDomainLcuuid,
581 })
582 }
583 for _, podServicePort := range resource.PodServicePorts {
584 retPodServicePorts = append(retPodServicePorts, model.PodServicePort{
585 Lcuuid: podServicePort.Lcuuid,
586 Name: podServicePort.Name,
587 Protocol: podServicePort.Protocol,
588 Port: podServicePort.Port,
589 TargetPort: podServicePort.TargetPort,
590 NodePort: podServicePort.NodePort,
591 PodServiceLcuuid: podServicePort.PodServiceLcuuid,
592 SubDomainLcuuid: subDomainLcuuid,
593 })
594 }
595 return retPodServices, retPodServicePorts
596}
597
598func (c *Cloud) getSubDomainPodGroups(
599 subDomainLcuuid string, resource *kubernetes_model.KubernetesGatherResource, azLcuuid string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected