From e37b87d63e129c641d9acd5949acf0b7d1ea28e8 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 11 Apr 2024 18:28:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=97=B6=20deploy=20=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=A2=AB=E8=A6=86=E7=9B=96=E7=9A=84=E9=97=AE=E9=A2=98=20(#4476?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_utils.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index 7705a1256..42779da45 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -1227,12 +1227,16 @@ func addDockerComposeCommonParam(composeMap map[string]interface{}, serviceName return buserr.New(constant.ErrFileParse) } serviceValue := service.(map[string]interface{}) - deploy := map[string]interface{}{ - "resources": map[string]interface{}{ - "limits": map[string]interface{}{ - "cpus": "${CPUS}", - "memory": "${MEMORY_LIMIT}", - }, + + deploy := map[string]interface{}{} + + if de, ok := serviceValue["deploy"]; ok { + deploy = de.(map[string]interface{}) + } + deploy["resources"] = map[string]interface{}{ + "limits": map[string]interface{}{ + "cpus": "${CPUS}", + "memory": "${MEMORY_LIMIT}", }, } serviceValue["deploy"] = deploy