Skip to content

Commit fd05885

Browse files
author
Matthew Fisher
committed
fix(controller): set default release image
If you scale an application with `deis scale cmd=1` before an application has been pushed, it should deploy deis/helloworld. However, the initial release (v1) does not have a image set for the release, only the build. Setting the default to deis/helloworld fixes the "scale before deploy" problem.
1 parent 9ab3868 commit fd05885

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

controller/api/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ class Release(UuidAuditedModel):
444444
config = models.ForeignKey('Config')
445445
build = models.ForeignKey('Build')
446446
# NOTE: image contains combined build + config, ready to run
447-
image = models.CharField(max_length=256)
447+
image = models.CharField(max_length=256, default=settings.DEFAULT_BUILD)
448448

449449
class Meta:
450450
get_latest_by = 'created'

controller/api/tests/test_release.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_release(self):
6060
self.assertIn('config', response.data)
6161
self.assertIn('build', response.data)
6262
self.assertEquals(release1['version'], 1)
63+
self.assertEquals(release1['image'], 'deis/helloworld')
6364
# check to see that a new release was created
6465
url = '/api/apps/{app_id}/releases/v2'.format(**locals())
6566
response = self.client.get(url)

0 commit comments

Comments
 (0)