@@ -94,7 +94,7 @@ func (c *calcium) doCreateContainerWithCPUPeriod(nodename string, connum int, qu
94
94
}
95
95
96
96
for i := 0 ; i < connum ; i ++ {
97
- config , hostConfig , networkConfig , containerName , err := c .makeContainerOptions (nil , specs , opts , "cpuperiod" , node . GetIP () )
97
+ config , hostConfig , networkConfig , containerName , err := c .makeContainerOptions (nil , specs , opts , "cpuperiod" , node )
98
98
ms [i ].ContainerName = containerName
99
99
ms [i ].Podname = opts .Podname
100
100
ms [i ].Nodename = node .Name
@@ -378,7 +378,7 @@ func (c *calcium) doCreateContainerWithScheduler(nodename string, cpumap []types
378
378
379
379
for i , quota := range cpumap {
380
380
// create options
381
- config , hostConfig , networkConfig , containerName , err := c .makeContainerOptions (quota , specs , opts , "scheduler" , node . GetIP () )
381
+ config , hostConfig , networkConfig , containerName , err := c .makeContainerOptions (quota , specs , opts , "scheduler" , node )
382
382
if err != nil {
383
383
log .Errorf ("Error when creating CreateContainerOptions, %v" , err )
384
384
ms [i ].Error = err .Error ()
@@ -484,7 +484,7 @@ func (c *calcium) releaseQuota(node *types.Node, quota types.CPUMap) {
484
484
c .store .UpdateNodeCPU (node .Podname , node .Name , quota , "+" )
485
485
}
486
486
487
- func (c * calcium ) makeContainerOptions (quota map [string ]int , specs types.Specs , opts * types.DeployOptions , optionMode , nodeIP string ) (
487
+ func (c * calcium ) makeContainerOptions (quota map [string ]int , specs types.Specs , opts * types.DeployOptions , optionMode string , node * types. Node ) (
488
488
* enginecontainer.Config ,
489
489
* enginecontainer.HostConfig ,
490
490
* enginenetwork.NetworkingConfig ,
@@ -539,10 +539,11 @@ func (c *calcium) makeContainerOptions(quota map[string]int, specs types.Specs,
539
539
}
540
540
541
541
// env
542
+ nodeIP := node .GetIP ()
542
543
env := append (opts .Env , fmt .Sprintf ("APP_NAME=%s" , specs .Appname ))
543
544
env = append (env , fmt .Sprintf ("ERU_POD=%s" , opts .Podname ))
544
545
env = append (env , fmt .Sprintf ("ERU_NODE_IP=%s" , nodeIP ))
545
- env = append (env , fmt .Sprintf ("ERU_NODE_NAME=%s" , opts . Nodename ))
546
+ env = append (env , fmt .Sprintf ("ERU_NODE_NAME=%s" , node . Name ))
546
547
env = append (env , fmt .Sprintf ("ERU_ZONE=%s" , c .config .Zone ))
547
548
548
549
// mount paths
0 commit comments