Skip to content

Commit

Permalink
remove old $APPNAME/permdir, and handles empty config.PermDir
Browse files Browse the repository at this point in the history
  • Loading branch information
timfeirg committed Apr 6, 2017
1 parent 50fca21 commit 43e12a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion cluster/calcium/build_image.go
Expand Up @@ -24,7 +24,6 @@ echo 32768 > /writable-proc/sys/net/core/somaxconn
echo 1 > /writable-proc/sys/vm/overcommit_memory
chmod 777 /dev/stdout
chmod 777 /dev/stderr
if [ -d {{.Appdir}}/{{.Appname}}/permdir ]; then chown {{.UID}} {{.Appdir}}/{{.Appname}}/permdir; fi
neednetwork=$1
if [ $neednetwork = "network" ]; then
Expand Down
4 changes: 3 additions & 1 deletion cluster/calcium/create_container.go
Expand Up @@ -555,8 +555,10 @@ func (c *calcium) makeContainerOptions(quota map[string]int, specs types.Specs,
env = append(env, fmt.Sprintf("ERU_NODE_IP=%s", nodeIP))
env = append(env, fmt.Sprintf("ERU_NODE_NAME=%s", node.Name))
env = append(env, fmt.Sprintf("ERU_ZONE=%s", c.config.Zone))
env = append(env, fmt.Sprintf("PERMDIR=%s", filepath.Join(c.config.PermDir, specs.Appname)))
env = append(env, fmt.Sprintf("APPDIR=%s", filepath.Join(c.config.AppDir, specs.Appname)))
if c.config.PermDir != "" {
env = append(env, fmt.Sprintf("PERMDIR=%s", filepath.Join(c.config.PermDir, specs.Appname)))
}

// mount paths
binds, volumes := makeMountPaths(specs, c.config)
Expand Down
4 changes: 3 additions & 1 deletion cluster/calcium/helper.go
Expand Up @@ -79,7 +79,9 @@ func makeMountPaths(specs types.Specs, config types.Config) ([]string, map[strin

var expandENV = func(env string) string {
envMap := make(map[string]string)
envMap["PERMDIR"] = filepath.Join(config.PermDir, specs.Appname)
if config.PermDir != "" {
envMap["PERMDIR"] = filepath.Join(config.PermDir, specs.Appname)
}
envMap["APPDIR"] = filepath.Join(config.AppDir, specs.Appname)
return envMap[env]
}
Expand Down

0 comments on commit 43e12a7

Please sign in to comment.