libnetwork: remove Network.EndpointByID as it must not be used#49341
Merged
thaJeztah merged 1 commit intomoby:masterfrom Jan 27, 2025
Merged
libnetwork: remove Network.EndpointByID as it must not be used#49341thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah merged 1 commit intomoby:masterfrom
Conversation
commit 80c44b4 removed uses of this method and added a comment that it should never be used; > EndpointByID should *never* be called as it's going to create a 2nd instance > of an Endpoint. The first one lives in the Sandbox the endpoint is attached to. > Instead, the endpoint should be retrieved by calling [Sandbox.Endpoints()]. Given that the only use of this method is in tests, we can remove if altogether. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Member
Author
|
😄 Stumbled on this one when cleaning up errors, when I noticed "should never be used!" and .. then found it was indeed never used, so let's remove it! 🧹 |
robmry
approved these changes
Jan 27, 2025
Contributor
robmry
left a comment
There was a problem hiding this comment.
LGTM
Unrelated Windows failures ...
=== FAIL: github.com/docker/docker/integration/container TestRenameAnonymousContainer (10.96s)
rename_test.go:151: assertion failed: 0 (int) != 1 (inspect.State.ExitCode int): container 5768112420fb67457165af681cc2e785c043069535c6bf8dd37636b02b8b8b4a exited with the wrong exitcode:
=== FAIL: github.com/docker/docker/integration/container TestAttach/with_TTY (60.32s)
attach_test.go:54: assertion failed: error is not nil: error during connect: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.48/containers/create": EOF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libnetwork: remove Network.EndpointByID as it must not be used
commit 80c44b4 removed uses of this method and added a comment that it should never be used;
Given that the only use of this method is in tests, we can remove if altogether.
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)