(agentInfo *dto.AgentInfo)
| 562 | } |
| 563 | |
| 564 | func getNodeIp(agentInfo *dto.AgentInfo) string { |
| 565 | var nodeIP string |
| 566 | if agentInfo != nil && agentInfo.NodeAddr != "" && agentInfo.NodeAddr != "127.0.0.1" { |
| 567 | nodeIP = agentInfo.NodeAddr |
| 568 | } |
| 569 | |
| 570 | return formatWithFallback(nodeIP, getFallbackIP) |
| 571 | } |
| 572 | |
| 573 | func formatWithFallback(value string, fallback func() string) string { |
| 574 | value = strings.TrimSpace(value) |
no test coverage detected