mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-11 16:06:02 +08:00
fix: 解决安装应用时 deploy 字段被覆盖的问题 (#4476)
This commit is contained in:
parent
37a0329d4a
commit
e37b87d63e
1 changed files with 10 additions and 6 deletions
|
@ -1227,12 +1227,16 @@ func addDockerComposeCommonParam(composeMap map[string]interface{}, serviceName
|
||||||
return buserr.New(constant.ErrFileParse)
|
return buserr.New(constant.ErrFileParse)
|
||||||
}
|
}
|
||||||
serviceValue := service.(map[string]interface{})
|
serviceValue := service.(map[string]interface{})
|
||||||
deploy := map[string]interface{}{
|
|
||||||
"resources": map[string]interface{}{
|
deploy := map[string]interface{}{}
|
||||||
"limits": map[string]interface{}{
|
|
||||||
"cpus": "${CPUS}",
|
if de, ok := serviceValue["deploy"]; ok {
|
||||||
"memory": "${MEMORY_LIMIT}",
|
deploy = de.(map[string]interface{})
|
||||||
},
|
}
|
||||||
|
deploy["resources"] = map[string]interface{}{
|
||||||
|
"limits": map[string]interface{}{
|
||||||
|
"cpus": "${CPUS}",
|
||||||
|
"memory": "${MEMORY_LIMIT}",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
serviceValue["deploy"] = deploy
|
serviceValue["deploy"] = deploy
|
||||||
|
|
Loading…
Add table
Reference in a new issue