fix: Fix the issue where deleting the host mapping in the runtime environment causes an error." (#12779)

This commit is contained in:
CityFun
2026-05-20 14:58:35 +08:00
committed by GitHub
parent 2c5728e27e
commit 7159aca226

View File

@@ -669,7 +669,7 @@ func handleCompose(env gotenv.Env, composeContent []byte, create request.Runtime
for _, host := range create.ExtraHosts {
extraHosts = append(extraHosts, fmt.Sprintf("%s:%s", host.Hostname, host.IP))
}
delete(serviceValue, "extraHosts")
delete(serviceValue, "extra_hosts")
if len(extraHosts) > 0 {
serviceValue["extra_hosts"] = extraHosts
}