Skip to content

Commit 232f99d

Browse files
committed
Merge branch 'refactor/volume' into 'master'
remove old $APPNAME/permdir, and handles empty config.PermDir See merge request !77
2 parents 50fca21 + 43e12a7 commit 232f99d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

cluster/calcium/build_image.go

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ echo 32768 > /writable-proc/sys/net/core/somaxconn
2424
echo 1 > /writable-proc/sys/vm/overcommit_memory
2525
chmod 777 /dev/stdout
2626
chmod 777 /dev/stderr
27-
if [ -d {{.Appdir}}/{{.Appname}}/permdir ]; then chown {{.UID}} {{.Appdir}}/{{.Appname}}/permdir; fi
2827
2928
neednetwork=$1
3029
if [ $neednetwork = "network" ]; then

cluster/calcium/create_container.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,10 @@ func (c *calcium) makeContainerOptions(quota map[string]int, specs types.Specs,
555555
env = append(env, fmt.Sprintf("ERU_NODE_IP=%s", nodeIP))
556556
env = append(env, fmt.Sprintf("ERU_NODE_NAME=%s", node.Name))
557557
env = append(env, fmt.Sprintf("ERU_ZONE=%s", c.config.Zone))
558-
env = append(env, fmt.Sprintf("PERMDIR=%s", filepath.Join(c.config.PermDir, specs.Appname)))
559558
env = append(env, fmt.Sprintf("APPDIR=%s", filepath.Join(c.config.AppDir, specs.Appname)))
559+
if c.config.PermDir != "" {
560+
env = append(env, fmt.Sprintf("PERMDIR=%s", filepath.Join(c.config.PermDir, specs.Appname)))
561+
}
560562

561563
// mount paths
562564
binds, volumes := makeMountPaths(specs, c.config)

cluster/calcium/helper.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ func makeMountPaths(specs types.Specs, config types.Config) ([]string, map[strin
7979

8080
var expandENV = func(env string) string {
8181
envMap := make(map[string]string)
82-
envMap["PERMDIR"] = filepath.Join(config.PermDir, specs.Appname)
82+
if config.PermDir != "" {
83+
envMap["PERMDIR"] = filepath.Join(config.PermDir, specs.Appname)
84+
}
8385
envMap["APPDIR"] = filepath.Join(config.AppDir, specs.Appname)
8486
return envMap[env]
8587
}

0 commit comments

Comments
 (0)