mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
952da245f8
commit
de588f950d
11 changed files with 26 additions and 26 deletions
|
@ -4,7 +4,7 @@ This document defines the high-level goals of the libnetwork project. See [Proje
|
||||||
|
|
||||||
## Long-term Goal
|
## Long-term Goal
|
||||||
|
|
||||||
libnetwork project will follow Docker and Linux philosophy of delivering small, highly modular and composable tools that works well independently.
|
libnetwork project will follow Docker and Linux philosophy of delivering small, highly modular and composable tools that work well independently.
|
||||||
libnetwork aims to satisfy that composable need for Networking in Containers.
|
libnetwork aims to satisfy that composable need for Networking in Containers.
|
||||||
|
|
||||||
## Short-term Goals
|
## Short-term Goals
|
||||||
|
|
|
@ -69,7 +69,7 @@ import (
|
||||||
// NetworkController provides the interface for controller instance which manages
|
// NetworkController provides the interface for controller instance which manages
|
||||||
// networks.
|
// networks.
|
||||||
type NetworkController interface {
|
type NetworkController interface {
|
||||||
// ID provides an unique identity for the controller
|
// ID provides a unique identity for the controller
|
||||||
ID() string
|
ID() string
|
||||||
|
|
||||||
// Config method returns the bootup configuration for the controller
|
// Config method returns the bootup configuration for the controller
|
||||||
|
@ -90,7 +90,7 @@ type NetworkController interface {
|
||||||
// NetworkByID returns the Network which has the passed id. If not found, the error ErrNoSuchNetwork is returned.
|
// NetworkByID returns the Network which has the passed id. If not found, the error ErrNoSuchNetwork is returned.
|
||||||
NetworkByID(id string) (Network, error)
|
NetworkByID(id string) (Network, error)
|
||||||
|
|
||||||
// NewSandbox cretes a new network sandbox for the passed container id
|
// NewSandbox creates a new network sandbox for the passed container id
|
||||||
NewSandbox(containerID string, options ...SandboxOption) (Sandbox, error)
|
NewSandbox(containerID string, options ...SandboxOption) (Sandbox, error)
|
||||||
|
|
||||||
// Sandboxes returns the list of Sandbox(s) managed by this controller.
|
// Sandboxes returns the list of Sandbox(s) managed by this controller.
|
||||||
|
|
|
@ -10,7 +10,7 @@ Please refer to this [Docker v1.6 Design](legacy.md) document for more informati
|
||||||
|
|
||||||
## Goal
|
## Goal
|
||||||
|
|
||||||
libnetwork project will follow Docker and Linux philosophy of developing small, highly modular and composable tools that works well independently.
|
libnetwork project will follow Docker and Linux philosophy of developing small, highly modular and composable tools that work well independently.
|
||||||
Libnetwork aims to satisfy that composable need for Networking in Containers.
|
Libnetwork aims to satisfy that composable need for Networking in Containers.
|
||||||
|
|
||||||
## The Container Network Model
|
## The Container Network Model
|
||||||
|
@ -73,7 +73,7 @@ Consumers of the CNM, like Docker for example, interact through the CNM Objects
|
||||||
|
|
||||||
2. `Network` is created using the controller's `NewNetwork()` API by providing a `name` and `networkType`. `networkType` parameter helps to choose a corresponding `Driver` and binds the created `Network` to that `Driver`. From this point, any operation on `Network` will be handled by that `Driver`.
|
2. `Network` is created using the controller's `NewNetwork()` API by providing a `name` and `networkType`. `networkType` parameter helps to choose a corresponding `Driver` and binds the created `Network` to that `Driver`. From this point, any operation on `Network` will be handled by that `Driver`.
|
||||||
|
|
||||||
3. `controller.NewNetwork()` API also takes in optional `options` parameter which carries Driver-specific options and `Labels`, which the Drivers can make use for its purpose.
|
3. `controller.NewNetwork()` API also takes in optional `options` parameter which carries Driver-specific options and `Labels`, which the Drivers can make use of for its purpose.
|
||||||
|
|
||||||
4. `network.CreateEndpoint()` can be called to create a new Endpoint in a given network. This API also accepts optional `options` parameter which drivers can make use of. These 'options' carry both well-known labels and driver-specific labels. Drivers will in turn be called with `driver.CreateEndpoint` and it can choose to reserve IPv4/IPv6 addresses when an `Endpoint` is created in a `Network`. The `Driver` will assign these addresses using `InterfaceInfo` interface defined in the `driverapi`. The IP/IPv6 are needed to complete the endpoint as service definition along with the ports the endpoint exposes since essentially a service endpoint is nothing but a network address and the port number that the application container is listening on.
|
4. `network.CreateEndpoint()` can be called to create a new Endpoint in a given network. This API also accepts optional `options` parameter which drivers can make use of. These 'options' carry both well-known labels and driver-specific labels. Drivers will in turn be called with `driver.CreateEndpoint` and it can choose to reserve IPv4/IPv6 addresses when an `Endpoint` is created in a `Network`. The `Driver` will assign these addresses using `InterfaceInfo` interface defined in the `driverapi`. The IP/IPv6 are needed to complete the endpoint as service definition along with the ports the endpoint exposes since essentially a service endpoint is nothing but a network address and the port number that the application container is listening on.
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ LibNetwork's Network and Endpoint APIs are primarily for managing the correspond
|
||||||
|
|
||||||
### Sandbox
|
### Sandbox
|
||||||
|
|
||||||
Libnetwork provides a framework to implement of a Sandbox in multiple operating systems. Currently we have implemented Sandbox for Linux using `namespace_linux.go` and `configure_linux.go` in `sandbox` package
|
Libnetwork provides a framework to implement of a Sandbox in multiple operating systems. Currently we have implemented Sandbox for Linux using `namespace_linux.go` and `configure_linux.go` in `sandbox` package.
|
||||||
This creates a Network Namespace for each sandbox which is uniquely identified by a path on the host filesystem.
|
This creates a Network Namespace for each sandbox which is uniquely identified by a path on the host filesystem.
|
||||||
Netlink calls are used to move interfaces from the global namespace to the Sandbox namespace.
|
Netlink calls are used to move interfaces from the global namespace to the Sandbox namespace.
|
||||||
Netlink is also used to manage the routing table in the namespace.
|
Netlink is also used to manage the routing table in the namespace.
|
||||||
|
@ -106,7 +106,7 @@ Netlink is also used to manage the routing table in the namespace.
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
Drivers are essentially an extension of libnetwork and provides the actual implementation for all of the LibNetwork APIs defined above. Hence there is an 1-1 correspondence for all the `Network` and `Endpoint` APIs, which includes :
|
Drivers are essentially an extension of libnetwork and provide the actual implementation for all of the LibNetwork APIs defined above. Hence there is an 1-1 correspondence for all the `Network` and `Endpoint` APIs, which includes :
|
||||||
* `driver.Config`
|
* `driver.Config`
|
||||||
* `driver.CreateNetwork`
|
* `driver.CreateNetwork`
|
||||||
* `driver.DeleteNetwork`
|
* `driver.DeleteNetwork`
|
||||||
|
@ -115,7 +115,7 @@ Drivers are essentially an extension of libnetwork and provides the actual imple
|
||||||
* `driver.Join`
|
* `driver.Join`
|
||||||
* `driver.Leave`
|
* `driver.Leave`
|
||||||
|
|
||||||
These Driver facing APIs makes use of unique identifiers (`networkid`,`endpointid`,...) instead of names (as seen in user-facing APIs).
|
These Driver facing APIs make use of unique identifiers (`networkid`,`endpointid`,...) instead of names (as seen in user-facing APIs).
|
||||||
|
|
||||||
The APIs are still work in progress and there can be changes to these based on the driver requirements especially when it comes to Multi-host networking.
|
The APIs are still work in progress and there can be changes to these based on the driver requirements especially when it comes to Multi-host networking.
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ When the proxy is asked to create a network, the remote process shall receive a
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
* `NetworkID` value is generated by LibNetwork which represents an unique network.
|
* `NetworkID` value is generated by LibNetwork which represents a unique network.
|
||||||
* `Options` value is the arbitrary map given to the proxy by LibNetwork.
|
* `Options` value is the arbitrary map given to the proxy by LibNetwork.
|
||||||
* `IPv4Data` and `IPv6Data` are the ip-addressing data configured by the user and managed by IPAM driver. The network driver is expected to honor the ip-addressing data supplied by IPAM driver. The data include,
|
* `IPv4Data` and `IPv6Data` are the ip-addressing data configured by the user and managed by IPAM driver. The network driver is expected to honor the ip-addressing data supplied by IPAM driver. The data include,
|
||||||
* `AddressSpace` : A unique string represents an isolated space for IP Addressing
|
* `AddressSpace` : A unique string represents an isolated space for IP Addressing
|
||||||
|
|
|
@ -35,7 +35,7 @@ func (einc *ErrInvalidNetworkConfig) Error() string {
|
||||||
// Forbidden denotes the type of this error
|
// Forbidden denotes the type of this error
|
||||||
func (einc *ErrInvalidNetworkConfig) Forbidden() {}
|
func (einc *ErrInvalidNetworkConfig) Forbidden() {}
|
||||||
|
|
||||||
// ErrInvalidContainerConfig error is returned when a endpoint create is attempted with an invalid configuration.
|
// ErrInvalidContainerConfig error is returned when an endpoint create is attempted with an invalid configuration.
|
||||||
type ErrInvalidContainerConfig struct{}
|
type ErrInvalidContainerConfig struct{}
|
||||||
|
|
||||||
func (eicc *ErrInvalidContainerConfig) Error() string {
|
func (eicc *ErrInvalidContainerConfig) Error() string {
|
||||||
|
@ -45,7 +45,7 @@ func (eicc *ErrInvalidContainerConfig) Error() string {
|
||||||
// BadRequest denotes the type of this error
|
// BadRequest denotes the type of this error
|
||||||
func (eicc *ErrInvalidContainerConfig) BadRequest() {}
|
func (eicc *ErrInvalidContainerConfig) BadRequest() {}
|
||||||
|
|
||||||
// ErrInvalidEndpointConfig error is returned when a endpoint create is attempted with an invalid endpoint configuration.
|
// ErrInvalidEndpointConfig error is returned when an endpoint create is attempted with an invalid endpoint configuration.
|
||||||
type ErrInvalidEndpointConfig struct{}
|
type ErrInvalidEndpointConfig struct{}
|
||||||
|
|
||||||
func (eiec *ErrInvalidEndpointConfig) Error() string {
|
func (eiec *ErrInvalidEndpointConfig) Error() string {
|
||||||
|
|
|
@ -24,7 +24,7 @@ type bridgeInterface struct {
|
||||||
|
|
||||||
// newInterface creates a new bridge interface structure. It attempts to find
|
// newInterface creates a new bridge interface structure. It attempts to find
|
||||||
// an already existing device identified by the configuration BridgeName field,
|
// an already existing device identified by the configuration BridgeName field,
|
||||||
// or the default bridge name when unspecified), but doesn't attempt to create
|
// or the default bridge name when unspecified, but doesn't attempt to create
|
||||||
// one when missing
|
// one when missing
|
||||||
func newInterface(config *networkConfiguration) *bridgeInterface {
|
func newInterface(config *networkConfiguration) *bridgeInterface {
|
||||||
i := &bridgeInterface{}
|
i := &bridgeInterface{}
|
||||||
|
|
|
@ -14,7 +14,7 @@ func (nsn ErrNoSuchNetwork) Error() string {
|
||||||
// NotFound denotes the type of this error
|
// NotFound denotes the type of this error
|
||||||
func (nsn ErrNoSuchNetwork) NotFound() {}
|
func (nsn ErrNoSuchNetwork) NotFound() {}
|
||||||
|
|
||||||
// ErrNoSuchEndpoint is returned when a endpoint query finds no result
|
// ErrNoSuchEndpoint is returned when an endpoint query finds no result
|
||||||
type ErrNoSuchEndpoint string
|
type ErrNoSuchEndpoint string
|
||||||
|
|
||||||
func (nse ErrNoSuchEndpoint) Error() string {
|
func (nse ErrNoSuchEndpoint) Error() string {
|
||||||
|
|
|
@ -33,7 +33,7 @@ func SetNamespace() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseHandlerInt transforms the namespace handler into a integer
|
// ParseHandlerInt transforms the namespace handler into an integer
|
||||||
func ParseHandlerInt() int {
|
func ParseHandlerInt() int {
|
||||||
return int(initNs)
|
return int(initNs)
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ type Sandbox interface {
|
||||||
Destroy() error
|
Destroy() error
|
||||||
}
|
}
|
||||||
|
|
||||||
// NeighborOptionSetter interfaces defines the option setter methods for interface options
|
// NeighborOptionSetter interface defines the option setter methods for interface options
|
||||||
type NeighborOptionSetter interface {
|
type NeighborOptionSetter interface {
|
||||||
// LinkName returns an option setter to set the srcName of the link that should
|
// LinkName returns an option setter to set the srcName of the link that should
|
||||||
// be used in the neighbor entry
|
// be used in the neighbor entry
|
||||||
|
@ -99,8 +99,8 @@ type IfaceOptionSetter interface {
|
||||||
// interfaces, routes and gateway
|
// interfaces, routes and gateway
|
||||||
type Info interface {
|
type Info interface {
|
||||||
// The collection of Interface previously added with the AddInterface
|
// The collection of Interface previously added with the AddInterface
|
||||||
// method. Note that this doesn't incude network interfaces added in any
|
// method. Note that this doesn't include network interfaces added in any
|
||||||
// other way (such as the default loopback interface which are automatically
|
// other way (such as the default loopback interface which is automatically
|
||||||
// created on creation of a sandbox).
|
// created on creation of a sandbox).
|
||||||
Interfaces() []Interface
|
Interfaces() []Interface
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ type Sandbox interface {
|
||||||
Labels() map[string]interface{}
|
Labels() map[string]interface{}
|
||||||
// Statistics retrieves the interfaces' statistics for the sandbox
|
// Statistics retrieves the interfaces' statistics for the sandbox
|
||||||
Statistics() (map[string]*types.InterfaceStatistics, error)
|
Statistics() (map[string]*types.InterfaceStatistics, error)
|
||||||
// Refresh leaves all the endpoints, resets and re-apply the options,
|
// Refresh leaves all the endpoints, resets and re-applies the options,
|
||||||
// re-joins all the endpoints without destroying the osl sandbox
|
// re-joins all the endpoints without destroying the osl sandbox
|
||||||
Refresh(options ...SandboxOption) error
|
Refresh(options ...SandboxOption) error
|
||||||
// SetKey updates the Sandbox Key
|
// SetKey updates the Sandbox Key
|
||||||
|
@ -890,7 +890,7 @@ func OptionHostsPath(path string) SandboxOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
// OptionOriginHostsPath function returns an option setter for origin hosts file path
|
// OptionOriginHostsPath function returns an option setter for origin hosts file path
|
||||||
// tbeo passed to NewSandbox method.
|
// to be passed to NewSandbox method.
|
||||||
func OptionOriginHostsPath(path string) SandboxOption {
|
func OptionOriginHostsPath(path string) SandboxOption {
|
||||||
return func(sb *sandbox) {
|
return func(sb *sandbox) {
|
||||||
sb.config.originHostsPath = path
|
sb.config.originHostsPath = path
|
||||||
|
|
|
@ -24,7 +24,7 @@ type QosPolicy struct {
|
||||||
MaxEgressBandwidth uint64
|
MaxEgressBandwidth uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
// TransportPort represent a local Layer 4 endpoint
|
// TransportPort represents a local Layer 4 endpoint
|
||||||
type TransportPort struct {
|
type TransportPort struct {
|
||||||
Proto Protocol
|
Proto Protocol
|
||||||
Port uint16
|
Port uint16
|
||||||
|
@ -70,7 +70,7 @@ func (t *TransportPort) FromString(s string) error {
|
||||||
return BadRequestErrorf("invalid format for transport port: %s", s)
|
return BadRequestErrorf("invalid format for transport port: %s", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PortBinding represent a port binding between the container and the host
|
// PortBinding represents a port binding between the container and the host
|
||||||
type PortBinding struct {
|
type PortBinding struct {
|
||||||
Proto Protocol
|
Proto Protocol
|
||||||
IP net.IP
|
IP net.IP
|
||||||
|
@ -116,7 +116,7 @@ func (p *PortBinding) GetCopy() PortBinding {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// String return the PortBinding structure in string form
|
// String returns the PortBinding structure in string form
|
||||||
func (p *PortBinding) String() string {
|
func (p *PortBinding) String() string {
|
||||||
ret := fmt.Sprintf("%s/", p.Proto)
|
ret := fmt.Sprintf("%s/", p.Proto)
|
||||||
if p.IP != nil {
|
if p.IP != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue