-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
wip: Use regex anchors to be sure we get bridge
from the docker network inspect command
#8034
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @alexjh! |
Hi @alexjh. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Can one of the admins verify this patch? |
Avoid returning a list of any networks that contain `bridge`.
4c77cf7
to
3741e4c
Compare
/check-cla |
/assign @afbjorklund |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the right way to fix this get list of all networks of type bridge, and then inspect them and see which one has the minikube container in it
$ docker network inspect bridge
[
{
"Name": "bridge",
"Id": "c2c5df7bc09a28dceec8df47e9f24053da7a310b0fc967b8f6140f5bcd2d71af",
"Created": "2020-05-02T00:23:57.187808648Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"00530626b5b0af4b03a72b9b6243c069b39747de92d9dcfe1dc4ecf5ff35e61d": {
"Name": "minikube",
"EndpointID": "dfc84498b1f7a690f246afa322b620bf5ca051107fd252bae2b8494e5e841ee5",
"MacAddress": "02:42:ac:11:00:02",
"IPv4Address": "172.17.0.2/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]
(in that case we would need to pass the profile name to the dockerGatewayIP()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afbjorklund, alexjh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Okay, let's do something else |
bridge
from the docker network inspect commandbridge
from the docker network inspect command
The comment in #8131 is that this second bridge network gets created by Docker Swarm |
Could we instead get it from the container itself?
|
yeah that works too, if you can prove it fixes the issue I am okay with that too |
I did a containerGatewayIP function for this, that we are using for podman But I have only tested on Linux, so I don't know if it works with the VMs |
@alexjh are you still interested to resolve the review comments? |
@alexjh I have not heared from you , I will have to close this PR if I dont hear from you |
Hey @alexjh as some time has passed without activity I'm going to close this PR -- feel free to open it whenever you have a chance! |
I still think this solution would have been the easiest fix to the issue, but I guess we can do something better. |
For whatever reason, my docker networks contain multiple bridges, two of them containing the text
bridge
. This change uses regex anchors to be sure we only get one.After the change: