[ Agent ] [ Base ] - refresh for euler
This commit is contained in:
@@ -17,6 +17,7 @@ func BuildAgentOsOperator(agentInfo *status.AgentInfo, ossOfflinePrefix string)
|
||||
CanAccessInternet: true,
|
||||
IsOsTypeUbuntu: true,
|
||||
IsOsTypeCentOS: false,
|
||||
IsOsTypeEuler: false,
|
||||
IsAgentInnerWall: false,
|
||||
AgentArch: "amd64",
|
||||
AgentOSReleaseCode: "focal",
|
||||
@@ -42,21 +43,25 @@ func detectByAgentStatusInfo(agentInfo *status.AgentInfo, os *AgentOsOperator) {
|
||||
bytes, _ := json.Marshal(agentInfo)
|
||||
log.DebugF("[detectByAgentStatusInfo] - agent info is => %s", string(bytes))
|
||||
|
||||
if strings.Contains(agentInfo.HostInfo.Platform, "openeuler") || strings.Contains(agentInfo.HostInfo.PlatformFamily, "platformFamily") {
|
||||
if strings.Contains(agentInfo.HostInfo.Platform, "openeuler") || strings.Contains(agentInfo.HostInfo.PlatformFamily, "rehl") {
|
||||
// centos
|
||||
os.IsOsTypeUbuntu = false
|
||||
os.IsOsTypeCentOS = true
|
||||
if strings.Contains(agentInfo.HostInfo.Platform, "openeuler") {
|
||||
os.IsOsTypeEuler = true
|
||||
}
|
||||
os.InstallCommandPrefix = []string{
|
||||
"yum", "install", "-y",
|
||||
}
|
||||
os.RemoveCommandPrefix = []string{
|
||||
"yum", "remove",
|
||||
"yum", "remove", "-y",
|
||||
}
|
||||
|
||||
} else if strings.Contains(agentInfo.HostInfo.PlatformFamily, "debian") {
|
||||
// ubuntu
|
||||
os.IsOsTypeUbuntu = true
|
||||
os.IsOsTypeCentOS = false
|
||||
os.IsOsTypeEuler = false
|
||||
os.RemoveCommandPrefix = []string{"apt", "remove", "-y"}
|
||||
os.InstallCommandPrefix = []string{
|
||||
"apt-get", "install", "--allow-downgrades", "-y",
|
||||
|
||||
Reference in New Issue
Block a user