Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
fix(controller): set default release image
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matthew Fisher committed May 28, 2014
1 parent 9ab3868 commit fd05885
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion controller/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class Release(UuidAuditedModel):
config = models.ForeignKey('Config')
build = models.ForeignKey('Build')
# NOTE: image contains combined build + config, ready to run
image = models.CharField(max_length=256)
image = models.CharField(max_length=256, default=settings.DEFAULT_BUILD)

class Meta:
get_latest_by = 'created'
Expand Down
1 change: 1 addition & 0 deletions controller/api/tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def test_release(self):
self.assertIn('config', response.data)
self.assertIn('build', response.data)
self.assertEquals(release1['version'], 1)
self.assertEquals(release1['image'], 'deis/helloworld')
# check to see that a new release was created
url = '/api/apps/{app_id}/releases/v2'.format(**locals())
response = self.client.get(url)
Expand Down

0 comments on commit fd05885

Please sign in to comment.