-
Notifications
You must be signed in to change notification settings - Fork 266
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
decouple container creation and container details retrieval #80
Conversation
@hellt I will add the "/" trimming to this PR after the other PR is merged. |
Creating the symlink doesn't hurt, it just creates a network namespace with the docker container name. In the future we can add a connect command that creates a link between 2 already existing docker containers. |
I conditioned this func, which creates a symlink https://github.com/srl-wim/container-lab/blob/a615950fe4de0b846e53ad8c30bdae610985894c/clab/docker.go#L339 |
LGTM |
I still think that change in cLab.CreateContainer is not right, it checks if there are links in the topology to create a symlink to the container PID, not if that specific container has link or not. What you are trying to fix here is better fixed in cLab.DeleteVirtualWiring, not during the container creation. It's better to create the symlink whether links are needed or not, and fix the destroy procedure. |
This reverts commit a615950.
reverted the commit |
Should be ok now, the destroy behavior can be resolved in another PR |
This PR decouples containers creation/starting and container inspect to get the IPs and PID.
This allows to run the creation and starting functions concurrently.
This PR also rewrites the hosts file generation function, as well as moving the inspect cmd table output to a separate function to allow its reuse in deploy command.
Got rid of a few log.Fatal as well, replaced by returning an error on the cobra command level