Browse Source

libnetwork: remove Network.Info() and remove NetworkInfo interface

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 year ago
parent
commit
3d0a7d819c
2 changed files with 7 additions and 32 deletions
  1. 3 2
      libnetwork/agent.go
  2. 4 30
      libnetwork/network.go

+ 3 - 2
libnetwork/agent.go

@@ -442,9 +442,9 @@ type epRecord struct {
 	lbIndex int
 }
 
+// Services returns a map of services keyed by the service name with the details
+// of all the tasks that belong to the service. Applicable only in swarm mode.
 func (n *Network) Services() map[string]ServiceInfo {
-	eps := make(map[string]epRecord)
-
 	if !n.isClusterEligible() {
 		return nil
 	}
@@ -455,6 +455,7 @@ func (n *Network) Services() map[string]ServiceInfo {
 
 	// Walk through libnetworkEPTable and fetch the driver agnostic endpoint info
 	entries := agent.networkDB.GetTableByNetwork(libnetworkEPTable, n.id)
+	eps := make(map[string]epRecord)
 	for eid, value := range entries {
 		var epRec EndpointRecord
 		nid := n.ID()

+ 4 - 30
libnetwork/network.go

@@ -25,31 +25,6 @@ import (
 	"github.com/docker/docker/pkg/stringid"
 )
 
-// NetworkInfo returns some configuration and operational information about the network
-type NetworkInfo interface {
-	IpamConfig() (string, map[string]string, []*IpamConf, []*IpamConf)
-	IpamInfo() ([]*IpamInfo, []*IpamInfo)
-	DriverOptions() map[string]string
-	Scope() string
-	IPv6Enabled() bool
-	Internal() bool
-	Attachable() bool
-	Ingress() bool
-	ConfigFrom() string
-	ConfigOnly() bool
-	Labels() map[string]string
-	Dynamic() bool
-	Created() time.Time
-	// Peers returns a slice of PeerInfo structures which has the information about the peer
-	// nodes participating in the same overlay network. This is currently the per-network
-	// gossip cluster. For non-dynamic overlay networks and bridge networks it returns an
-	// empty slice
-	Peers() []networkdb.PeerInfo
-	// Services returns a map of services keyed by the service name with the details
-	// of all the tasks that belong to the service. Applicable only in swarm mode.
-	Services() map[string]ServiceInfo
-}
-
 // EndpointWalker is a client provided function which will be used to walk the Endpoints.
 // When the function returns true, the walk will stop.
 type EndpointWalker func(ep *Endpoint) bool
@@ -1772,11 +1747,10 @@ func (n *Network) deriveAddressSpace() (string, error) {
 	return local, nil
 }
 
-// Info returns certain operational data belonging to this network.
-func (n *Network) Info() NetworkInfo {
-	return n
-}
-
+// Peers returns a slice of PeerInfo structures which has the information about the peer
+// nodes participating in the same overlay network. This is currently the per-network
+// gossip cluster. For non-dynamic overlay networks and bridge networks it returns an
+// empty slice
 func (n *Network) Peers() []networkdb.PeerInfo {
 	if !n.Dynamic() {
 		return []networkdb.PeerInfo{}