Skip to content

Commit e568f83

Browse files
author
Matthew Fisher
committed
fix(scheduler): send environment to the process
1 parent 6884604 commit e568f83

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

controller/api/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def _get_command(self):
406406
return ''
407407
try:
408408
# ensure they cannot break out and run commands on the host
409-
return "bash -c '{}'".format(self.release.build.procfile[self.type])
409+
return "env '{}'".format(self.release.build.procfile[self.type])
410410
# if the key is not present or if a parent attribute is None
411411
except (KeyError, TypeError):
412412
return 'start {}'.format(self.type)

controller/api/tests/test_container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ def test_command_good(self):
461461
release=release,
462462
type='web',
463463
num=1)
464-
self.assertEqual(c._command, "bash -c 'node server.js'")
464+
self.assertEqual(c._command, "env 'node server.js'")
465465
c.type = 'worker'
466-
self.assertEqual(c._command, "bash -c 'node worker.js'")
466+
self.assertEqual(c._command, "env 'node worker.js'")
467467
c.release.build.procfile = None
468468
self.assertEqual(c._command, 'start worker')
469469
c.type = 'cmd'

tests/config_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var (
1212
configListCmd = "config:list --app={{.AppName}}"
1313
configSetCmd = "config:set FOO=讲台 --app={{.AppName}}"
1414
configSet2Cmd = "config:set FOO=10 --app={{.AppName}}"
15-
configSet3Cmd = "config:set HELLO=\"from the Deis team\" --app={{.AppName}}"
15+
configSet3Cmd = "config:set POWERED_BY=\"the Deis team\" --app={{.AppName}}"
1616
configUnsetCmd = "config:unset FOO --app={{.AppName}}"
1717
)
1818

@@ -43,8 +43,9 @@ func configSetup(t *testing.T) *utils.DeisTestConfig {
4343
utils.Execute(t, appsCreateCmd, cfg, false, "")
4444
// ensure envvars with spaces work fine on `git push`
4545
// https://github.com/deis/deis/issues/2477
46-
utils.Execute(t, configSet3Cmd, cfg, false, "from the Deis team")
46+
utils.Execute(t, configSet3Cmd, cfg, false, "the Deis team")
4747
utils.Execute(t, gitPushCmd, cfg, false, "")
48+
utils.CurlWithFail(t, cfg, false, "the Deis team")
4849
if err := utils.Chdir(".."); err != nil {
4950
t.Fatal(err)
5051
}

0 commit comments

Comments
 (0)