Skip to content

Commit f3e75ea

Browse files
committed
Revert "citadel knows nothing about core error"
This reverts commit 40c708a.
1 parent 385a370 commit f3e75ea

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

cluster/calcium/create_container.go

+2-21
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,16 @@ func (c *calcium) CreateContainer(specs types.Specs, opts *types.DeployOptions)
3030
}
3131
}
3232

33-
// when shits go wrong before doCreateContainerWithCPUPeriod, don't just return
34-
// the channel and return an error, because citadel don't know what's going on
35-
func (c *calcium) createErrorMessage(err error) *types.CreateContainerMessage {
36-
log.Errorf("Got error %s", err.Error())
37-
m := &types.CreateContainerMessage{
38-
Podname: "",
39-
Nodename: "",
40-
ContainerID: "",
41-
ContainerName: "",
42-
Error: err.Error(),
43-
Success: false,
44-
CPU: nil,
45-
Memory: 0,
46-
}
47-
return m
48-
}
49-
5033
func (c *calcium) createContainerWithCPUPeriod(specs types.Specs, opts *types.DeployOptions) (chan *types.CreateContainerMessage, error) {
5134
ch := make(chan *types.CreateContainerMessage)
5235

5336
if opts.Memory < 4194304 { // 4194304 Byte = 4 MB, docker 创建容器的内存最低标准
54-
err := fmt.Errorf("Minimum memory limit allowed is 4MB")
55-
ch <- c.createErrorMessage(err)
56-
return ch, err
37+
return ch, fmt.Errorf("Minimum memory limit allowed is 4MB")
5738
}
5839

5940
cpuandmem, _, err := c.getCPUAndMem(opts.Podname, opts.Nodename, 1.0)
6041
if err != nil {
61-
ch <- c.createErrorMessage(err)
42+
log.Errorf("Got error %v after getCPUAndMem", err)
6243
return ch, err
6344
}
6445
nodesInfo := utils.GetNodesInfo(cpuandmem)

0 commit comments

Comments
 (0)