Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DockerNetworkService swapped Network ID and Name #85

Closed
eugendun opened this issue May 16, 2019 · 2 comments
Closed

DockerNetworkService swapped Network ID and Name #85

eugendun opened this issue May 16, 2019 · 2 comments
Assignees
Labels
bug under-development Denotes that a issue is under development but not yet released.

Comments

@eugendun
Copy link

Hallo,

I wrote a unit test which asserts the presence of a container and found out that the Network ID and the Name of the docker network are swapped on DockerNetworkService.

DockerNetworkService

image

docker network ls

image

mongodb-compose.yml

version: '3.3'

services:
  mongodb:
    image: mongo:latest
    volumes:
      - mongodb-data:/data
      - /D/data:/backup_data
    command: mongod --smallfiles --bind_ip=0.0.0.0 --logpath=/dev/null
    expose:
      - 27017
    networks:
      - mongodb-network

volumes: 
  mongodb-data:

networks:
  mongodb-network:

Code where is try to resolve the network name of mongodb service

var file = Path.Combine(Directory.GetCurrentDirectory(), "Compose/mongodb-compose.yml");

services = Fd
  .UseContainer()
  .UseCompose()
  .FromFile(file)
  .KeepOnDispose()
  .KeepVolumes()
  .Build().Start();

var mongodbContainer = services.Services.Where(s => s is IContainerService).Single() as IContainerService;
var networkService = mongodbContainer.GetNetworks().Single();
@eugendun eugendun changed the title NetworkService swaped Network ID and Name DockerNetworkService swaped Network ID and Name May 16, 2019
@eugendun eugendun changed the title DockerNetworkService swaped Network ID and Name DockerNetworkService swapped Network ID and Name May 16, 2019
@mariotoffia mariotoffia self-assigned this May 17, 2019
@mariotoffia mariotoffia added bug under-development Denotes that a issue is under development but not yet released. labels May 17, 2019
@mariotoffia mariotoffia added this to To do in FluentDocker via automation May 17, 2019
mariotoffia pushed a commit that referenced this issue May 17, 2019
@mariotoffia
Copy link
Owner

Thanks for the great bug report! It's easy to fix when I get good ones like this! :) - Fixed at pushed to nuget - version 2.6.7.

Cheers,
Mario

FluentDocker automation moved this from To do to Done May 17, 2019
@eugendun
Copy link
Author

Thank you! The project is awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug under-development Denotes that a issue is under development but not yet released.
Projects
FluentDocker
  
Done
Development

No branches or pull requests

2 participants