Skip to content

Commit ab4f7a5

Browse files
committed
fix(controller): do not set entrypoint when no procfile
1 parent ffd08c6 commit ab4f7a5

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

rootfs/api/models/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,11 @@ def _get_entrypoint(self, container_type):
153153
"""
154154
Return the kubernetes "container command" to be sent off to the scheduler.
155155
"""
156-
entrypoint = ['/bin/sh', '-c']
156+
entrypoint = []
157157
release = self.release_set.filter(failed=False).latest()
158+
if release is not None and release.build is not None:
159+
if release.build.procfile and container_type in release.build.procfile:
160+
entrypoint = ['/bin/sh', '-c']
158161
if self._get_stack(release) == "buildpack":
159162
if container_type in release.build.procfile:
160163
entrypoint = [container_type]

rootfs/api/tests/test_pods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def test_run_command_good(self, mock_requests):
589589
response = self.client.post(url, body)
590590
self.assertEqual(response.status_code, 200, response.data)
591591
app = App.objects.get(id=app_id)
592-
self.assertEqual(app._get_entrypoint('cmd'), ['/bin/sh', '-c'])
592+
self.assertEqual(app._get_entrypoint('cmd'), [])
593593

594594
# procfile workflow
595595
build.sha = 'somereallylongsha'

0 commit comments

Comments
 (0)