From d7dd2dc2c50bd088db57d1755eacdbfec69c1d6d Mon Sep 17 00:00:00 2001 From: zhengya Date: Wed, 18 Dec 2024 17:42:18 +0800 Subject: [PATCH] fix: failed to create agent group config using yaml --- server/controller/http/service/agent_group_config.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/controller/http/service/agent_group_config.go b/server/controller/http/service/agent_group_config.go index 25ca519ecdf..16c6143f808 100644 --- a/server/controller/http/service/agent_group_config.go +++ b/server/controller/http/service/agent_group_config.go @@ -244,7 +244,7 @@ func (a *AgentGroupConfig) CreateAgentGroupConfig(groupLcuuid string, data inter if dataType == DataTypeJSON { log.Infof("create agent group config, group lcuuid: %s, data: %#v, data type: %d", groupLcuuid, data, dataType, dbInfo.LogPrefixORGID) } else { - log.Infof("create agent group config, group lcuuid: %s, data: %s, data type: %d", groupLcuuid, data.(string), dataType, dbInfo.LogPrefixORGID) + log.Infof("create agent group config, group lcuuid: %s, data: %s, data type: %d", groupLcuuid, string(data.([]byte)), dataType, dbInfo.LogPrefixORGID) } var agentGroup model.VTapGroup if err := dbInfo.Where("lcuuid = ?", groupLcuuid).First(&agentGroup).Error; err != nil { @@ -328,7 +328,11 @@ func (a *AgentGroupConfig) UpdateAgentGroupConfig(groupLcuuid string, data inter if err != nil { return nil, err } - log.Infof("update agent group config, group lcuuid: %s, data: %#v, data type: %d", groupLcuuid, data, dataType, dbInfo.LogPrefixORGID) + if dataType == DataTypeJSON { + log.Infof("update agent group config, group lcuuid: %s, data: %#v, data type: %d", groupLcuuid, data, dataType, dbInfo.LogPrefixORGID) + } else { + log.Infof("update agent group config, group lcuuid: %s, data: %s, data type: %d", groupLcuuid, string(data.([]byte)), dataType, dbInfo.LogPrefixORGID) + } var agentGroup model.VTapGroup if err := dbInfo.Where("lcuuid = ?", groupLcuuid).First(&agentGroup).Error; err != nil { return nil, err