Skip to content

Commit d6dcb58

Browse files
committed
fix(controller): set entrypoint when docker run cmd
1 parent 5037bbf commit d6dcb58

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

rootfs/api/models/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def _get_entrypoint(self, container_type):
156156
entrypoint = []
157157
release = self.release_set.filter(failed=False).latest()
158158
if release is not None and release.build is not None:
159-
if release.build.procfile and container_type in release.build.procfile:
159+
if (release.build.procfile and container_type in release.build.procfile) \
160+
or container_type == "run":
160161
entrypoint = ['/bin/sh', '-c']
161162
if self._get_stack(release) == "buildpack":
162163
if container_type in release.build.procfile:

rootfs/api/tests/test_pods.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ def test_run_command_good(self, mock_requests):
590590
self.assertEqual(response.status_code, 200, response.data)
591591
app = App.objects.get(id=app_id)
592592
self.assertEqual(app._get_entrypoint('cmd'), [])
593+
self.assertEqual(app._get_entrypoint('run'), ['/bin/sh', '-c'])
593594

594595
# procfile workflow
595596
build.sha = 'somereallylongsha'

0 commit comments

Comments
 (0)