1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

fix error message and typos in swarm cluster

Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
allencloud 2016-06-25 02:52:28 +08:00
parent bf08aae852
commit 39bc10c36d
2 changed files with 13 additions and 13 deletions

View file

@ -109,7 +109,7 @@ func (sr *swarmRouter) createService(ctx context.Context, w http.ResponseWriter,
id, err := sr.backend.CreateService(service) id, err := sr.backend.CreateService(service)
if err != nil { if err != nil {
logrus.Errorf("Error reating service %s: %v", id, err) logrus.Errorf("Error creating service %s: %v", id, err)
return err return err
} }

View file

@ -85,8 +85,8 @@ type Config struct {
Backend executorpkg.Backend Backend executorpkg.Backend
} }
// Cluster provides capabilities to pariticipate in a cluster as worker or a // Cluster provides capabilities to participate in a cluster as a worker or a
// manager and a worker. // manager.
type Cluster struct { type Cluster struct {
sync.RWMutex sync.RWMutex
root string root string
@ -418,7 +418,7 @@ func (c *Cluster) Leave(force bool) error {
} }
} }
} else { } else {
msg += "Doing so may lose the consenus of your cluster. " msg += "Doing so may lose the consensus of your cluster. "
} }
msg += "Only way to restore a cluster that has lost consensus is to reinitialize it with `--force-new-cluster`. Use `--force` to ignore this message." msg += "Only way to restore a cluster that has lost consensus is to reinitialize it with `--force-new-cluster`. Use `--force` to ignore this message."
@ -470,7 +470,7 @@ func (c *Cluster) getRequestContext() context.Context { // TODO: not needed when
return ctx return ctx
} }
// Inspect retrives the confuguration properties of managed swarm cluster. // Inspect retrieves the configuration properties of a managed swarm cluster.
func (c *Cluster) Inspect() (types.Swarm, error) { func (c *Cluster) Inspect() (types.Swarm, error) {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()
@ -523,21 +523,21 @@ func (c *Cluster) Update(version uint64, spec types.Spec) error {
return err return err
} }
// IsManager returns true is Cluster is participating as a manager. // IsManager returns true if Cluster is participating as a manager.
func (c *Cluster) IsManager() bool { func (c *Cluster) IsManager() bool {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()
return c.isActiveManager() return c.isActiveManager()
} }
// IsAgent returns true is Cluster is participating as a worker/agent. // IsAgent returns true if Cluster is participating as a worker/agent.
func (c *Cluster) IsAgent() bool { func (c *Cluster) IsAgent() bool {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()
return c.ready return c.ready
} }
// GetListenAddress returns the listening address for current maanger's // GetListenAddress returns the listening address for current manager's
// consensus and dispatcher APIs. // consensus and dispatcher APIs.
func (c *Cluster) GetListenAddress() string { func (c *Cluster) GetListenAddress() string {
c.RLock() c.RLock()
@ -548,7 +548,7 @@ func (c *Cluster) GetListenAddress() string {
return "" return ""
} }
// GetRemoteAddress returns a known advertise address of a remote maanger if // GetRemoteAddress returns a known advertise address of a remote manager if
// available. // available.
// todo: change to array/connect with info // todo: change to array/connect with info
func (c *Cluster) GetRemoteAddress() string { func (c *Cluster) GetRemoteAddress() string {
@ -686,7 +686,7 @@ func (c *Cluster) CreateService(s types.ServiceSpec) (string, error) {
return r.Service.ID, nil return r.Service.ID, nil
} }
// GetService returns a service based on a ID or name. // GetService returns a service based on an ID or name.
func (c *Cluster) GetService(input string) (types.Service, error) { func (c *Cluster) GetService(input string) (types.Service, error) {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()
@ -777,7 +777,7 @@ func (c *Cluster) GetNodes(options apitypes.NodeListOptions) ([]types.Node, erro
return nodes, nil return nodes, nil
} }
// GetNode returns a node based on a ID or name. // GetNode returns a node based on an ID or name.
func (c *Cluster) GetNode(input string) (types.Node, error) { func (c *Cluster) GetNode(input string) (types.Node, error) {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()
@ -886,7 +886,7 @@ func (c *Cluster) GetTask(input string) (types.Task, error) {
return convert.TaskFromGRPC(*task), nil return convert.TaskFromGRPC(*task), nil
} }
// GetNetwork returns a cluster network by ID. // GetNetwork returns a cluster network by an ID.
func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error) { func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error) {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()