MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / getNodeIp

Function getNodeIp

agent/utils/alert/alert.go:564–571  ·  view source on GitHub ↗
(agentInfo *dto.AgentInfo)

Source from the content-addressed store, hash-verified

562}
563
564func 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
573func formatWithFallback(value string, fallback func() string) string {
574 value = strings.TrimSpace(value)

Callers 1

GetSendContentFunction · 0.85

Calls 1

formatWithFallbackFunction · 0.85

Tested by

no test coverage detected