fix: 解决应用内存限制回显失败的问题 (#1237)

pull/1241/head
zhengkunwang223 2 years ago committed by GitHub
parent 3773d64aa7
commit 957499e4d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -900,7 +900,7 @@ func getAppCommonConfig(envs map[string]interface{}) request.AppContainerConfig
config.CpuQuota = 0 config.CpuQuota = 0
} }
if memLimit, ok := envs[constant.MemoryLimit]; ok { if memLimit, ok := envs[constant.MemoryLimit]; ok {
re := regexp.MustCompile(`(\d+(?:\.\d+)?)\s*([KMGT]?B)`) re := regexp.MustCompile(`(\d+)([A-Za-z]+)`)
matches := re.FindStringSubmatch(memLimit.(string)) matches := re.FindStringSubmatch(memLimit.(string))
if len(matches) == 3 { if len(matches) == 3 {
num, err := strconv.ParseFloat(matches[1], 64) num, err := strconv.ParseFloat(matches[1], 64)

Loading…
Cancel
Save