[ Agent ] [ Initialization ] - add harbor func - 1

This commit is contained in:
zeaslity
2023-11-09 13:58:58 +08:00
parent aae4b7a286
commit cdfa4b5d04
8 changed files with 120 additions and 101 deletions

View File

@@ -1,6 +1,9 @@
package executor
import "strings"
import (
"strconv"
"strings"
)
func BuildAgentOsOperator(osInfo string, ossOfflinePrefix string) *AgentOsOperator {
@@ -84,8 +87,6 @@ func detectByOsType(os *AgentOsOperator, osInfo string) {
func detectByInternet(os *AgentOsOperator) {
log.Info("开始检测Agent的网络连通情况!")
outsideTestUrl := "www.google.com"
innerTestUrl := "www.baidu.com"
@@ -109,4 +110,6 @@ func detectByInternet(os *AgentOsOperator) {
os.IsAgentInnerWall = true
}
log.InfoF("[Agent Network Status] - Can Access Internet => %s Inner CN => %s", strconv.FormatBool(os.CanAccessInternet), strconv.FormatBool(os.IsAgentInnerWall))
}