mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 02:45:42 +03:00
Run gofmt
This commit is contained in:
@@ -150,14 +150,14 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e
|
||||
}
|
||||
|
||||
if task.Resources.MemoryMB == 0 {
|
||||
return nil, fmt.Errorf("Memory limit cannot be zero")
|
||||
}
|
||||
if task.Resources.CPU == 0 {
|
||||
return nil, fmt.Errorf("CPU limit cannot be zero")
|
||||
}
|
||||
return nil, fmt.Errorf("Memory limit cannot be zero")
|
||||
}
|
||||
if task.Resources.CPU == 0 {
|
||||
return nil, fmt.Errorf("CPU limit cannot be zero")
|
||||
}
|
||||
|
||||
// Add memory isolator
|
||||
cmd_args = append(cmd_args, fmt.Sprintf("--memory=%vM", int64(task.Resources.MemoryMB) * 1024 * 1024))
|
||||
cmd_args = append(cmd_args, fmt.Sprintf("--memory=%vM", int64(task.Resources.MemoryMB)*1024*1024))
|
||||
|
||||
// Add CPU isolator
|
||||
cmd_args = append(cmd_args, fmt.Sprintf("--cpu=%vm", int64(task.Resources.CPU)))
|
||||
|
||||
@@ -125,10 +125,10 @@ func TestRktDriver_Start_Wait(t *testing.T) {
|
||||
"command": "/etcd",
|
||||
"args": []string{"--version"},
|
||||
},
|
||||
Resources: &structs.Resources{
|
||||
MemoryMB: 256,
|
||||
CPU: 512,
|
||||
},
|
||||
Resources: &structs.Resources{
|
||||
MemoryMB: 256,
|
||||
CPU: 512,
|
||||
},
|
||||
}
|
||||
|
||||
driverCtx := testDriverContext(task.Name)
|
||||
@@ -170,10 +170,10 @@ func TestRktDriver_Start_Wait_Skip_Trust(t *testing.T) {
|
||||
"command": "/etcd",
|
||||
"args": []string{"--version"},
|
||||
},
|
||||
Resources: &structs.Resources{
|
||||
MemoryMB: 256,
|
||||
CPU: 512,
|
||||
},
|
||||
Resources: &structs.Resources{
|
||||
MemoryMB: 256,
|
||||
CPU: 512,
|
||||
},
|
||||
}
|
||||
|
||||
driverCtx := testDriverContext(task.Name)
|
||||
@@ -216,10 +216,10 @@ func TestRktDriver_Start_Wait_Logs(t *testing.T) {
|
||||
"command": "/etcd",
|
||||
"args": []string{"--version"},
|
||||
},
|
||||
Resources: &structs.Resources{
|
||||
MemoryMB: 256,
|
||||
CPU: 512,
|
||||
},
|
||||
Resources: &structs.Resources{
|
||||
MemoryMB: 256,
|
||||
CPU: 512,
|
||||
},
|
||||
}
|
||||
|
||||
driverCtx := testDriverContext(task.Name)
|
||||
|
||||
Reference in New Issue
Block a user