Merge pull request #4571 from jperville/docker-provider-allow-multiple-links-to-same-backend
providers/docker: allow multiple links to same backend (different aliases)
This commit is contained in:
commit
f122ed756c
|
@ -96,10 +96,10 @@ module VagrantPlugins
|
||||||
image = @env[:create_image]
|
image = @env[:create_image]
|
||||||
image ||= @provider_config.image
|
image ||= @provider_config.image
|
||||||
|
|
||||||
links = {}
|
links = []
|
||||||
@provider_config._links.each do |link|
|
@provider_config._links.each do |link|
|
||||||
parts = link.split(":", 2)
|
parts = link.split(":", 2)
|
||||||
links[parts[0]] = parts[1]
|
links << parts
|
||||||
end
|
end
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ describe VagrantPlugins::DockerProvider::Driver do
|
||||||
ports: '8080:80',
|
ports: '8080:80',
|
||||||
volumes: '/host/path:guest/path',
|
volumes: '/host/path:guest/path',
|
||||||
detach: true,
|
detach: true,
|
||||||
links: {janis: 'joplin'},
|
links: [[:janis, 'joplin'], [:janis, 'janis']],
|
||||||
env: {key: 'value'},
|
env: {key: 'value'},
|
||||||
name: cid,
|
name: cid,
|
||||||
hostname: 'jimi-hendrix',
|
hostname: 'jimi-hendrix',
|
||||||
|
@ -43,7 +43,9 @@ describe VagrantPlugins::DockerProvider::Driver do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'links containers' do
|
it 'links containers' do
|
||||||
expect(cmd_executed).to match(/--link #{params[:links].to_a.flatten.join(':')} .+ #{Regexp.escape params[:image]}/)
|
params[:links].each do |link|
|
||||||
|
expect(cmd_executed).to match(/--link #{link.join(':')} .+ #{Regexp.escape params[:image]}/)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sets environmental variables' do
|
it 'sets environmental variables' do
|
||||||
|
|
Loading…
Reference in New Issue