Closed shenshouer closed 8 years ago
I changed code and goes ok :
nanoCPUs := new(big.Rat).SetInt64(req.Cores)
cpuRat := new(big.Rat).Mul(nanoCPUs, big.NewRat(1e9, 1))
if !cpuRat.IsInt() {
err = fmt.Errorf("CPU value cannot have more than 9 decimal places: %s", req.Cores)
return
}
tspec.Resources.Limits.NanoCPUs = cpuRat.Num().Int64()
I create service code :
set the
req.Cores = 2
and report error:
but I run with cli is ok: