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

[18.09 backport] Correctly clean up --config-only networks #2391

Conversation

thaJeztah
Copy link
Member

backport of #2373 for 18.09

The endpoint count for --config-only networks
was being incremented even when the respective --config-from
inherited network failed to create a network

This was due to a variable shadowing problem with err causing
the deferred function to not execute correctly.

Using the same err variable across the entire function fixes
the issue

Fixes: moby/moby#35101

@thaJeztah
Copy link
Member Author

ping @arkodg @euanh ptal

@thaJeztah
Copy link
Member Author

Looks like I need to cherry-pick something else to make CI work again;

 ---> Running in 02bf29242f22
package honnef.co/go/tools/cmd/gosimple: cannot find package "honnef.co/go/tools/cmd/gosimple" in any of:
	/usr/local/go/src/honnef.co/go/tools/cmd/gosimple (from $GOROOT)
	/go/src/honnef.co/go/tools/cmd/gosimple (from $GOPATH)
The command '/bin/sh -c go get golang.org/x/lint/golint 		golang.org/x/tools/cmd/cover 		github.com/mattn/goveralls 		github.com/gordonklaus/ineffassign 		github.com/client9/misspell/cmd/misspell 		honnef.co/go/tools/cmd/gosimple' returned a non-zero code: 1
Makefile:39: recipe for target 'builder' failed
make: *** [builder] Error 1
Exited with code 2
```

@euanh
Copy link
Collaborator

euanh commented Jun 7, 2019

@thaJeztah: try this

commit 23fc2c97e0c05ba4cb279a655cdd810cdcca8417
Author: Tibor Vass <tibor@docker.com>
Date:   Fri May 31 20:52:43 2019 +0000

    remove gosimple - package is gone and it's not important
    
    Also fixes issue reported by ineffassign
    
    Signed-off-by: Tibor Vass <tibor@docker.com>

@thaJeztah
Copy link
Member Author

I know the commit to backport; 23fc2c9 (part of #2385)

@thaJeztah
Copy link
Member Author

opened #2392 with the backport for that fix; I'll rebase this one after that's merged

The endpoint count for --config-only networks
was being incremented even when the respective --config-from
inherited network failed to create a network

This was due to a variable shadowing problem with err causing
the deferred function to not execute correctly.

Using the same err variable across the entire function fixes
the issue

Fixes: moby/moby#35101

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
(cherry picked from commit eacb56d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the 18.09_backport_ungraceful_exit_config_from_net_clean branch from 6e8a883 to b2e61e9 Compare June 24, 2019 08:38
@thaJeztah
Copy link
Member Author

@selansen @arkodg rebased (now that #2392 was merged); PTAL

@euanh euanh merged commit cb951c5 into moby:bump_18.09 Jun 24, 2019
@thaJeztah thaJeztah deleted the 18.09_backport_ungraceful_exit_config_from_net_clean branch June 24, 2019 12:59
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Jul 23, 2019
full diff: moby/libnetwork@e7933d4...55685ba

changes included:

- moby/libnetwork#2382 Backporting PR 2069 to bump_18.09
  - backport of https://github.com/docker/libnetwork#2069 Rolling back the port configs if failed to programIngress()
- moby/libnetwork#2363 [18.09] align dependencies with engine 18.09
- moby/libnetwork#2400 [18.09 backport] Fix TestValidRemoteDriver GetCapabilities errors
- moby/libnetwork#2391 [18.09 backport] Correctly clean up --config-only networks
  - backport of moby/libnetwork#2373
  - fixes moby#35101
- moby/libnetwork#2392 [18.09 backport] remove gosimple - package is gone and it's not important

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Jul 25, 2019
full diff: moby/libnetwork@e7933d4...55685ba

changes included:

- moby/libnetwork#2382 Backporting PR 2069 to bump_18.09
  - backport of https://github.com/docker/libnetwork#2069 Rolling back the port configs if failed to programIngress()
- moby/libnetwork#2363 [18.09] align dependencies with engine 18.09
- moby/libnetwork#2400 [18.09 backport] Fix TestValidRemoteDriver GetCapabilities errors
- moby/libnetwork#2391 [18.09 backport] Correctly clean up --config-only networks
  - backport of moby/libnetwork#2373
  - fixes moby/moby#35101
- moby/libnetwork#2392 [18.09 backport] remove gosimple - package is gone and it's not important

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0a3767c7e9803f0a595a07b0548e99d60e861062
Component: engine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants