-
Notifications
You must be signed in to change notification settings - Fork 674
Do not skip bridge creation if bridge exists #3204
Conversation
To include LinkNotFoundError.
Both cmds depend on running weaver which creates the bridge during its initialization. So, calling "create_bridge" during execution of the cmds is redundant.
"weave attach $CIDR $CONTAINER_ID" is no longer possible w/o running weaver. This feature was undocumented and complicated the weave script, as "weave attach" required to call "create_bridge". Removing the feature allows us to eliminate the bridge creation from the script. Running "weave attach" w/o weaver results in the following err: bridge "weave" not present; did you launch weave? Also, this commit simplifies the "attach-container" cmd from weaveutil by removing "mtu" as a param. The cmd is used only by "weave attach", and a mtu is value for an attached container interface is exactly the same as one of the weave bridge.
No longer needed in the weave script and thus, in weaveutil.
EnsureBridge used to skip creation and initialization of the weave bridge and friends if such existed. This caused problems when EnsureBridge failed before completing all init steps and so, subsequent weaver could not work without "weave reset". This change makes EnsureBridge idempotent.
As commented on the other issue, thank you very much for this. The “reboot bug” bit us more than once. |
On my phone, so hard to read, but does this also ensure iptables correctness? |
Yep, it should. If you want to do an early testing, please let me know - I could build images for you. |
I’d be happy to test. We have an infra sandbox where we setup and tear down clusters all the time (automated through terraform) so more than happy to run tests there if you can provide an image. |
f2972fd
to
14768d6
Compare
@deitch Cool, thanks! You can start using the fixed version (for testing purpose) by replacing |
PTAL |
Will do @brb, thank you. |
Looks good to me! Please do tag version here when it is merged in and released. |
@deitch Thanks! I'm waiting for someone to review the PR. |
I have read through the code, and that all seems fine. |
I certainly am excited for this. It makes weave far more resilient. Instead of "works from nothing" and "works when it already works", it becomes, "always ensure good state on startup". |
7d72764
to
bcc8968
Compare
bcc8968
to
1d67e2f
Compare
@bboreham It will restore iptables rules. The filter/FORWARD rules are restored in a correct order. Also, I've extended the 191 integration test to test restoration of iptables rules. PTAL - two new commits since your review. |
for _, rs := range rulespecs { | ||
// If any is missing, then delete all, as we need to preserve the order of | ||
// given rules. Ignore errors, as rule might not exist. | ||
if !allFound { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I like the table of rules - in future we should be able to use the same table to remove them on |
Fabulous! What version will it (did it?) go into? |
2.2; I'd like to get #3210 in too |
Thanks @bboreham. Is there an ETA? |
Nice #3210 is merged too. So 2.2? |
We are experiencing some integration test failures, so we would like to fix those before doing 2.2. |
Thanks @brb. Not that I have any cycles, but we have gotten bit by this one several times now. If there is anything we can do to help move it along, let us know? |
Weave Net release 2.2 just out https://github.com/weaveworks/weave/releases/tag/v2.2.0 |
Really great! Thanks to all! Does it automatically get pushed to docker hub? |
Yes, it's there on Docker Hub now |
Ah, got it. By default, it only shows scanned tags, not unscanned. |
I recommend to review each commit separately.
This PR does a few things:
create_bridge
from the weave script. As a consequence,weave attach $CIDR $CONTAINER
is no longer possible without running weaver.create_bridge
fromweave expose
andweave hide
.net/bridge.go:EnsureBridge
do not skip creation of the bridge if such already exists, and also makes the function idempotent.Part of the #3133 fix; going to add netlink subscribe for changes to the bridge in a separate PR.