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

Commit

Permalink
do not remove service links
Browse files Browse the repository at this point in the history
  • Loading branch information
greyarch committed Jul 24, 2017
1 parent 5f00e35 commit db054d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/coffee/compose.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = (config) ->
for l in links
deps[l] = condition: 'service_started' unless deps[l]
service.depends_on = deps
delete service.links
# delete service.links

_resolvePath: resolvePath = (root, path) ->
path = path[1...] if path[0] is '/'
Expand Down
22 changes: 14 additions & 8 deletions tests/coffee/compose.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,30 @@ describe 'Compose', ->
links: ['db']
depends_on: ['some_other_service']
compose(standardCfg)._migrateLinksToDependsOn '', service
assert.deepEqual service, depends_on:
db: {condition: 'service_started'}
some_other_service: {condition: 'service_started'}
assert.deepEqual service,
links: ['db']
depends_on:
db: {condition: 'service_started'}
some_other_service: {condition: 'service_started'}
it 'should merge all links with all depends_on (as object) services', ->
service =
links: ['db']
depends_on: some_other_service: condition: 'some_condition'
compose(standardCfg)._migrateLinksToDependsOn '', service
assert.deepEqual service, depends_on:
db: {condition: 'service_started'}
some_other_service: {condition: 'some_condition'}
assert.deepEqual service,
links: ['db']
depends_on:
db: {condition: 'service_started'}
some_other_service: {condition: 'some_condition'}
it 'should prefer a dependency from depends_on over one from links if they are the same', ->
service =
links: ['db']
depends_on: db: condition: 'my_specific_condition'
compose(standardCfg)._migrateLinksToDependsOn '', service
assert.deepEqual service, depends_on:
db: {condition: 'my_specific_condition'}
assert.deepEqual service,
links: ['db']
depends_on:
db: {condition: 'my_specific_condition'}

describe '_resolvePath', ->
it 'should resolve a path relative to a given root', ->
Expand Down

0 comments on commit db054d6

Please sign in to comment.