Skip to content

Commit

Permalink
Merge pull request moby#48821 from robmry/remove_islinkable
Browse files Browse the repository at this point in the history
Remove function isLinkable
  • Loading branch information
thaJeztah authored Nov 5, 2024
2 parents 6c2e77a + e601e71 commit 070ebb9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
8 changes: 1 addition & 7 deletions daemon/container_operations_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (daemon *Daemon) addLegacyLinks(
return nil
}
for _, child := range children {
if !isLinkable(child) {
if _, ok := child.NetworkSettings.Networks[network.DefaultNetwork]; !ok {
return fmt.Errorf("Cannot link to %s, as it does not belong to the default network", child.Name)
}
}
Expand Down Expand Up @@ -487,12 +487,6 @@ func killProcessDirectly(ctr *container.Container) error {
return nil
}

func isLinkable(child *container.Container) bool {
// A container is linkable only if it belongs to the default network
_, ok := child.NetworkSettings.Networks[network.DefaultNetwork]
return ok
}

// TODO(aker): remove when we make the default bridge network behave like any other network
func enableIPOnPredefinedNetwork() bool {
return false
Expand Down
4 changes: 0 additions & 4 deletions daemon/container_operations_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ func killProcessDirectly(ctr *container.Container) error {
return nil
}

func isLinkable(child *container.Container) bool {
return false
}

func enableIPOnPredefinedNetwork() bool {
return true
}
Expand Down

0 comments on commit 070ebb9

Please sign in to comment.