Browse code

why there are so many mistakes in our repo (up to /cmd)

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>

Aaron.L.Xu authored on 2017/02/17 00:56:53
Showing 19 changed files
... ...
@@ -18,7 +18,7 @@ type ContainerAttachConfig struct {
18 18
 	Stream     bool
19 19
 	DetachKeys string
20 20
 
21
-	// Used to signify that streams are multiplexed and therefore need a StdWriter to encode stdout/sderr messages accordingly.
21
+	// Used to signify that streams are multiplexed and therefore need a StdWriter to encode stdout/stderr messages accordingly.
22 22
 	// TODO @cpuguy83: This shouldn't be needed. It was only added so that http and websocket endpoints can use the same function, and the websocket function was not using a stdwriter prior to this change...
23 23
 	// HOWEVER, the websocket endpoint is using a single stream and SHOULD be encoded with stdout/stderr as is done for HTTP since it is still just a single stream.
24 24
 	// Since such a change is an API change unrelated to the current changeset we'll keep it as is here and change separately.
... ...
@@ -179,9 +179,9 @@ func TestBuilderFlags(t *testing.T) {
179 179
 	}
180 180
 
181 181
 	if flStr1.Value != "BYE" {
182
-		t.Fatalf("Teset %s, str1 should be BYE", bf.Args)
182
+		t.Fatalf("Test %s, str1 should be BYE", bf.Args)
183 183
 	}
184 184
 	if !flBool1.IsTrue() {
185
-		t.Fatalf("Teset %s, bool1 should be true", bf.Args)
185
+		t.Fatalf("Test %s, bool1 should be true", bf.Args)
186 186
 	}
187 187
 }
... ...
@@ -724,7 +724,7 @@ func stopSignal(b *Builder, args []string, attributes map[string]bool, original
724 724
 // ARG name[=value]
725 725
 //
726 726
 // Adds the variable foo to the trusted list of variables that can be passed
727
-// to builder using the --build-arg flag for expansion/subsitution or passing to 'run'.
727
+// to builder using the --build-arg flag for expansion/substitution or passing to 'run'.
728 728
 // Dockerfile author may optionally set a default value of this variable.
729 729
 func arg(b *Builder, args []string, attributes map[string]bool, original string) error {
730 730
 	if len(args) != 1 {
... ...
@@ -210,7 +210,7 @@ func TestFrom(t *testing.T) {
210 210
 		}
211 211
 
212 212
 		if b.image != "" {
213
-			t.Fatalf("Image shoule be empty, got: %s", b.image)
213
+			t.Fatalf("Image should be empty, got: %s", b.image)
214 214
 		}
215 215
 
216 216
 		if b.noBaseImage != true {
... ...
@@ -16,7 +16,7 @@ func TestEmptyDockerfile(t *testing.T) {
16 16
 
17 17
 	createTestTempFile(t, contextDir, builder.DefaultDockerfileName, "", 0777)
18 18
 
19
-	readAndCheckDockerfile(t, "emptyDockefile", contextDir, "", "The Dockerfile (Dockerfile) cannot be empty")
19
+	readAndCheckDockerfile(t, "emptyDockerfile", contextDir, "", "The Dockerfile (Dockerfile) cannot be empty")
20 20
 }
21 21
 
22 22
 func TestSymlinkDockerfile(t *testing.T) {
... ...
@@ -40,7 +40,7 @@ type Node struct {
40 40
 // parsing directives.
41 41
 type Directive struct {
42 42
 	EscapeToken           rune           // Current escape token
43
-	LineContinuationRegex *regexp.Regexp // Current line contination regex
43
+	LineContinuationRegex *regexp.Regexp // Current line continuation regex
44 44
 	LookingForDirectives  bool           // Whether we are currently looking for directives
45 45
 	EscapeSeen            bool           // Whether the escape directive has been seen
46 46
 }
... ...
@@ -32,7 +32,7 @@ func newExecOptions() *execOptions {
32 32
 	}
33 33
 }
34 34
 
35
-// NewExecCommand creats a new cobra.Command for `docker exec`
35
+// NewExecCommand creates a new cobra.Command for `docker exec`
36 36
 func NewExecCommand(dockerCli *command.DockerCli) *cobra.Command {
37 37
 	opts := newExecOptions()
38 38
 
... ...
@@ -22,7 +22,7 @@ func marshalMap(x interface{}) (map[string]interface{}, error) {
22 22
 		return nil, fmt.Errorf("expected a pointer to a struct, got %v", val.Kind())
23 23
 	}
24 24
 	if val.IsNil() {
25
-		return nil, fmt.Errorf("expxected a pointer to a struct, got nil pointer")
25
+		return nil, fmt.Errorf("expected a pointer to a struct, got nil pointer")
26 26
 	}
27 27
 	valElem := val.Elem()
28 28
 	if valElem.Kind() != reflect.Struct {
... ...
@@ -120,7 +120,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command {
120 120
 
121 121
 // lastProgressOutput is the same as progress.Output except
122 122
 // that it only output with the last update. It is used in
123
-// non terminal scenarios to depresss verbose messages
123
+// non terminal scenarios to suppress verbose messages
124 124
 type lastProgressOutput struct {
125 125
 	output progress.Output
126 126
 }
... ...
@@ -91,7 +91,7 @@ func GetContextFromReader(r io.ReadCloser, dockerfileName string) (out io.ReadCl
91 91
 	// Input should be read as a Dockerfile.
92 92
 	tmpDir, err := ioutil.TempDir("", "docker-build-context-")
93 93
 	if err != nil {
94
-		return nil, "", fmt.Errorf("unbale to create temporary context directory: %v", err)
94
+		return nil, "", fmt.Errorf("unable to create temporary context directory: %v", err)
95 95
 	}
96 96
 
97 97
 	f, err := os.Create(filepath.Join(tmpDir, DefaultDockerfileName))
... ...
@@ -106,7 +106,7 @@ func runCreate(dockerCli *command.DockerCli, opts createOptions) error {
106 106
 // Consolidates the ipam configuration as a group from different related configurations
107 107
 // user can configure network with multiple non-overlapping subnets and hence it is
108 108
 // possible to correlate the various related parameters and consolidate them.
109
-// consoidateIpam consolidates subnets, ip-ranges, gateways and auxiliary addresses into
109
+// consolidateIpam consolidates subnets, ip-ranges, gateways and auxiliary addresses into
110 110
 // structured ipam data.
111 111
 func consolidateIpam(subnets, ranges, gateways []string, auxaddrs map[string]string) ([]network.IPAMConfig, error) {
112 112
 	if len(subnets) < len(ranges) || len(subnets) < len(gateways) {
... ...
@@ -31,7 +31,7 @@ func TestSwarmInitErrorOnAPIFailure(t *testing.T) {
31 31
 			expectedError: "error initializing the swarm",
32 32
 		},
33 33
 		{
34
-			name: "init-faild-with-ip-choice",
34
+			name: "init-failed-with-ip-choice",
35 35
 			swarmInitFunc: func() (string, error) {
36 36
 				return "", fmt.Errorf("could not choose an IP address to advertise")
37 37
 			},
... ...
@@ -137,7 +137,7 @@ type StringOrNumberList []string
137 137
 // key=value strings
138 138
 type MappingWithEquals map[string]string
139 139
 
140
-// MappingWithColon is a mapping type that can be converted from alist of
140
+// MappingWithColon is a mapping type that can be converted from a list of
141 141
 // 'key: value' strings
142 142
 type MappingWithColon map[string]string
143 143
 
... ...
@@ -120,7 +120,7 @@ func (c *nativeStore) getCredentialsFromStore(serverAddress string) (types.AuthC
120 120
 	if err != nil {
121 121
 		if credentials.IsErrCredentialsNotFound(err) {
122 122
 			// do not return an error if the credentials are not
123
-			// in the keyckain. Let docker ask for new credentials.
123
+			// in the keychain. Let docker ask for new credentials.
124 124
 			return ret, nil
125 125
 		}
126 126
 		return ret, err
... ...
@@ -22,7 +22,7 @@ func TestContainerCreateError(t *testing.T) {
22 22
 		t.Fatalf("expected a Server Error while testing StatusInternalServerError, got %v", err)
23 23
 	}
24 24
 
25
-	// 404 doesn't automagitally means an unknown image
25
+	// 404 doesn't automatically means an unknown image
26 26
 	client = &Client{
27 27
 		client: newMockClient(errorMock(http.StatusNotFound, "Server error")),
28 28
 	}
... ...
@@ -22,7 +22,7 @@ func TestImageTagError(t *testing.T) {
22 22
 	}
23 23
 }
24 24
 
25
-// Note: this is not testing all the InvalidReference as it's the reponsability
25
+// Note: this is not testing all the InvalidReference as it's the responsibility
26 26
 // of distribution/reference package.
27 27
 func TestImageTagInvalidReference(t *testing.T) {
28 28
 	client := &Client{
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"golang.org/x/net/context"
6 6
 )
7 7
 
8
-// SwarmUnlock unlockes locked swarm.
8
+// SwarmUnlock unlocks locked swarm.
9 9
 func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error {
10 10
 	serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil)
11 11
 	ensureReaderClosed(serverResp)
... ...
@@ -679,7 +679,7 @@ Use `df <source-dir>` to figure out the source mount and then use
679 679
 `findmnt -o TARGET,PROPAGATION <source-mount-dir>` to figure out propagation
680 680
 properties of source mount. If `findmnt` utility is not available, then one
681 681
 can look at mount entry for source mount point in `/proc/self/mountinfo`. Look
682
-at `optional fields` and see if any propagaion properties are specified.
682
+at `optional fields` and see if any propagation properties are specified.
683 683
 `shared:X` means mount is `shared`, `master:X` means mount is `slave` and if
684 684
 nothing is there that means mount is `private`.
685 685
 
... ...
@@ -653,7 +653,7 @@ Example use: `dockerd -s zfs --storage-opt zfs.fsname=zroot/docker`
653 653
 
654 654
 #### btrfs.min_space
655 655
 
656
-Specifies the mininum size to use when creating the subvolume which is used for
656
+Specifies the minimum size to use when creating the subvolume which is used for
657 657
 containers. If user uses disk quota for btrfs when creating or running a
658 658
 container with **--storage-opt size** option, docker should ensure the **size**
659 659
 cannot be smaller than **btrfs.min_space**.