diff --git a/cluster/config.go b/cluster/config.go index a46b5f5731..34582b0b50 100644 --- a/cluster/config.go +++ b/cluster/config.go @@ -78,12 +78,12 @@ func BuildContainerConfig(c dockerclient.ContainerConfig) *ContainerConfig { json.Unmarshal([]byte(labels), &affinities) } - // parse contraints from labels (ex. docker run --label 'com.docker.swarm.constraints=["region==us-east","storage==ssd"]') + // parse constraints from labels (ex. docker run --label 'com.docker.swarm.constraints=["region==us-east","storage==ssd"]') if labels, ok := c.Labels[SwarmLabelNamespace+".constraints"]; ok { json.Unmarshal([]byte(labels), &constraints) } - // parse affinities/contraints from env (ex. docker run -e affinity:container==redis -e affinity:image==nginx -e constraint:region==us-east -e constraint:storage==ssd) + // parse affinities/constraints from env (ex. docker run -e affinity:container==redis -e affinity:image==nginx -e constraint:region==us-east -e constraint:storage==ssd) for _, e := range c.Env { if ok, key, value := parseEnv(e); ok && key == "affinity" { affinities = append(affinities, value) @@ -94,7 +94,7 @@ func BuildContainerConfig(c dockerclient.ContainerConfig) *ContainerConfig { } } - // remove affinities/contraints from env + // remove affinities/constraints from env c.Env = env // store affinities in labels @@ -104,7 +104,7 @@ func BuildContainerConfig(c dockerclient.ContainerConfig) *ContainerConfig { } } - // store contraints in labels + // store constraints in labels if len(constraints) > 0 { if labels, err := json.Marshal(constraints); err == nil { c.Labels[SwarmLabelNamespace+".constraints"] = string(labels) diff --git a/cluster/swarm/cluster.go b/cluster/swarm/cluster.go index c080b55719..ff2f203feb 100644 --- a/cluster/swarm/cluster.go +++ b/cluster/swarm/cluster.go @@ -106,7 +106,7 @@ func (c *Cluster) createContainer(config *cluster.ContainerConfig, name string, c.scheduler.Lock() defer c.scheduler.Unlock() - // Ensure the name is avaliable + // Ensure the name is available if cID := c.getIDFromName(name); cID != "" { return nil, fmt.Errorf("Conflict, The name %s is already assigned to %s. You have to delete (or rename) that container to be able to assign %s to a container again.", name, cID, name) } @@ -579,7 +579,7 @@ func (c *Cluster) RenameContainer(container *cluster.Container, newName string) c.RLock() defer c.RUnlock() - // check new name whether avaliable + // check new name whether available if cID := c.getIDFromName(newName); cID != "" { return fmt.Errorf("Conflict, The name %s is already assigned to %s. You have to delete (or rename) that container to be able to assign %s to a container again.", newName, cID, newName) } diff --git a/scheduler/filter/constraint_test.go b/scheduler/filter/constraint_test.go index 2d8d0cd136..efd7c4647b 100644 --- a/scheduler/filter/constraint_test.go +++ b/scheduler/filter/constraint_test.go @@ -65,7 +65,7 @@ func TestConstrainteFilter(t *testing.T) { assert.NoError(t, err) assert.Equal(t, result, nodes) - // Set a constraint that cannot be fullfilled and expect an error back. + // Set a constraint that cannot be fulfilled and expect an error back. result, err = f.Filter(cluster.BuildContainerConfig(dockerclient.ContainerConfig{Env: []string{"constraint:does_not_exist==true"}}), nodes) assert.Error(t, err) @@ -75,7 +75,7 @@ func TestConstrainteFilter(t *testing.T) { assert.Len(t, result, 1) assert.Equal(t, result[0], nodes[1]) - // This constraint can only be fullfilled by a subset of nodes. + // This constraint can only be fulfilled by a subset of nodes. result, err = f.Filter(cluster.BuildContainerConfig(dockerclient.ContainerConfig{Env: []string{"constraint:group==1"}}), nodes) assert.NoError(t, err) assert.Len(t, result, 2) diff --git a/scheduler/filter/port.go b/scheduler/filter/port.go index fe9a11f3be..35bef22bff 100644 --- a/scheduler/filter/port.go +++ b/scheduler/filter/port.go @@ -101,7 +101,7 @@ func (p *PortFilter) compare(requested dockerclient.PortBinding, bindings map[st for _, b := range binding { if b.HostPort == "" { // Skip undefined HostPorts. This happens in bindings that - // didn't explicitely specify an external port. + // didn't explicitly specify an external port. continue } diff --git a/test/integration/api/attach.bats b/test/integration/api/attach.bats index 92cecced8c..894d1014dd 100644 --- a/test/integration/api/attach.bats +++ b/test/integration/api/attach.bats @@ -35,7 +35,7 @@ skip # test attach-ws api # jimmyxian/centos7-wssh is an image with websocket CLI(WSSH) wirtten in Python - # if connected successfull, it returns two lines, "Session Open" and "Session Closed" + # if connected successful, it returns two lines, "Session Open" and "Session Closed" # Note: with stdout=1&stdin=1&stream=1: it can be used as SSH URL="ws://${SWARM_HOST}/${CLIENT_API_VERSION}/containers/test_container/attach/ws?stderr=1" run docker_host run --rm --net=host jimmyxian/centos7-wssh wssh $URL diff --git a/test/integration/api/commit.bats b/test/integration/api/commit.bats index fac9b45eab..6b4f54839e 100644 --- a/test/integration/api/commit.bats +++ b/test/integration/api/commit.bats @@ -18,7 +18,7 @@ function teardown() { [ "${#lines[@]}" -eq 2 ] [[ "${lines[1]}" == *"test_container"* ]] - # no comming name before commit + # no coming name before commit run docker_swarm images [ "$status" -eq 0 ] [[ "${output}" != *"commit_image_busybox"* ]] diff --git a/test/integration/api/exec.bats b/test/integration/api/exec.bats index c7fbb79f1c..48539ebe9a 100644 --- a/test/integration/api/exec.bats +++ b/test/integration/api/exec.bats @@ -12,7 +12,7 @@ function teardown() { swarm_manage docker_swarm create --name test_container busybox sleep 100 - # if container is not runing, exec will failed + # if container is not running, exec will failed run docker_swarm exec test_container ls [ "$status" -ne 0 ] [[ "$output" == *"is not running"* ]] diff --git a/test/integration/api/ps.bats b/test/integration/api/ps.bats index cff12a31b4..014fea6a6e 100644 --- a/test/integration/api/ps.bats +++ b/test/integration/api/ps.bats @@ -51,7 +51,7 @@ function teardown() { # Running firstID=$(docker_swarm run -d --name name1 --label "match=me" --label "second=tag" busybox sleep 10000) - # Exited - successfull + # Exited - successful secondID=$(docker_swarm run -d --name name2 --label "match=me too" busybox true) docker_swarm wait "$secondID" # Exited - error diff --git a/test/integration/api/rename.bats b/test/integration/api/rename.bats index 225bc90747..8e11687ffc 100644 --- a/test/integration/api/rename.bats +++ b/test/integration/api/rename.bats @@ -27,7 +27,7 @@ function teardown() { [ "$status" -ne 0 ] [[ "${output}" == *"Conflict,"* ]] - # rename container, sucessful + # rename container, successful docker_swarm rename test_container rename_container # verify after, rename diff --git a/test/integration/api/tag.bats b/test/integration/api/tag.bats index 1bed1a09e7..be31326f47 100644 --- a/test/integration/api/tag.bats +++ b/test/integration/api/tag.bats @@ -15,7 +15,7 @@ function teardown() { swarm_manage # make sure the image of busybox exists - # the comming image of tag_busybox not exsit + # the coming image of tag_busybox not exsit run docker_swarm images [ "$status" -eq 0 ] [ "${#lines[@]}" -ge 2 ] diff --git a/test/integration/mesos/api/commit.bats b/test/integration/mesos/api/commit.bats index 7f4d61fb68..816636e840 100644 --- a/test/integration/mesos/api/commit.bats +++ b/test/integration/mesos/api/commit.bats @@ -20,7 +20,7 @@ function teardown() { [ "${#lines[@]}" -eq 2 ] [[ "${lines[1]}" == *"test_container"* ]] - # no comming name before commit + # no coming name before commit run docker_swarm images [ "$status" -eq 0 ] [[ "${output}" != *"commit_image_busybox"* ]]