From 3758c8a541f0caf284799c0a1e317dd983ff2832 Mon Sep 17 00:00:00 2001 From: liugq Date: Thu, 3 Aug 2023 15:44:47 +0800 Subject: [PATCH] store host platform with lowwercase --- modules/agent/api/host.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/agent/api/host.go b/modules/agent/api/host.go index f9aeffeb..4fb061c8 100644 --- a/modules/agent/api/host.go +++ b/modules/agent/api/host.go @@ -14,6 +14,7 @@ import ( "infini.sh/framework/core/orm" "infini.sh/framework/core/util" "net/http" + "strings" "time" ) @@ -80,6 +81,7 @@ func (h *APIHandler) enrollHost(w http.ResponseWriter, req *http.Request, ps htt Refresh: "wait_for", } } + hostInfo.OSInfo.Platform = strings.ToLower(hostInfo.OSInfo.Platform) err = orm.Create(ctx, hostInfo) if err != nil { errors[hi.IP] = util.MapStr{