Signed-off-by: allencloud <allen.sun@daocloud.io>
| ... | ... |
@@ -378,7 +378,7 @@ The rules: |
| 378 | 378 |
5. Document _all_ declarations and methods, even private ones. Declare |
| 379 | 379 |
expectations, caveats and anything else that may be important. If a type |
| 380 | 380 |
gets exported, having the comments already there will ensure it's ready. |
| 381 |
-6. Variable name length should be proportional to it's context and no longer. |
|
| 381 |
+6. Variable name length should be proportional to its context and no longer. |
|
| 382 | 382 |
`noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo`. |
| 383 | 383 |
In practice, short methods will have short variable names and globals will |
| 384 | 384 |
have longer names. |
| ... | ... |
@@ -386,7 +386,7 @@ The rules: |
| 386 | 386 |
and re-examine why you need a compound name. If you still think you need a |
| 387 | 387 |
compound name, lose the underscore. |
| 388 | 388 |
8. No utils or helpers packages. If a function is not general enough to |
| 389 |
- warrant it's own package, it has not been written generally enough to be a |
|
| 389 |
+ warrant its own package, it has not been written generally enough to be a |
|
| 390 | 390 |
part of a util package. Just leave it unexported and well-documented. |
| 391 | 391 |
9. All tests should run with `go test` and outside tooling should not be |
| 392 | 392 |
required. No, we don't need another unit testing framework. Assertion |
| ... | ... |
@@ -7,7 +7,7 @@ import ( |
| 7 | 7 |
clientapi "github.com/docker/engine-api/client" |
| 8 | 8 |
) |
| 9 | 9 |
|
| 10 |
-// getExitCode perform an inspect on the container. It returns |
|
| 10 |
+// getExitCode performs an inspect on the container. It returns |
|
| 11 | 11 |
// the running state and the exit code. |
| 12 | 12 |
func getExitCode(dockerCli *client.DockerCli, ctx context.Context, containerID string) (bool, int, error) {
|
| 13 | 13 |
c, err := dockerCli.Client().ContainerInspect(ctx, containerID) |
| ... | ... |
@@ -48,7 +48,7 @@ int main(int argc, char **argv) |
| 48 | 48 |
child_stack = stack + STACK_SIZE; /* Assume stack grows downward */ |
| 49 | 49 |
|
| 50 | 50 |
// the result of this call is that our child_exec will be run in another |
| 51 |
- // process returning it's pid |
|
| 51 |
+ // process returning its pid |
|
| 52 | 52 |
pid_t pid = clone(child_exec, child_stack, clone_flags, &args); |
| 53 | 53 |
if (pid < 0) {
|
| 54 | 54 |
fprintf(stderr, "clone failed: %s\n", strerror(errno)); |
| ... | ... |
@@ -48,7 +48,7 @@ int main(int argc, char **argv) |
| 48 | 48 |
child_stack = stack + STACK_SIZE; /* Assume stack grows downward */ |
| 49 | 49 |
|
| 50 | 50 |
// the result of this call is that our child_exec will be run in another |
| 51 |
- // process returning it's pid |
|
| 51 |
+ // process returning its pid |
|
| 52 | 52 |
pid_t pid = clone(child_exec, child_stack, clone_flags, &args); |
| 53 | 53 |
if (pid < 0) {
|
| 54 | 54 |
fprintf(stderr, "clone failed: %s\n", strerror(errno)); |
| ... | ... |
@@ -105,7 +105,7 @@ func TestGetContainer(t *testing.T) {
|
| 105 | 105 |
} |
| 106 | 106 |
|
| 107 | 107 |
if container, _ := daemon.GetContainer("d22d69a2b896"); container != c5 {
|
| 108 |
- t.Fatal("Should match a container where the provided prefix is an exact match to the it's name, and is also a prefix for it's ID")
|
|
| 108 |
+ t.Fatal("Should match a container where the provided prefix is an exact match to the its name, and is also a prefix for its ID")
|
|
| 109 | 109 |
} |
| 110 | 110 |
|
| 111 | 111 |
if _, err := daemon.GetContainer("3cdbd1"); err == nil {
|
| ... | ... |
@@ -34,7 +34,7 @@ func TestContainerDoubleDelete(t *testing.T) {
|
| 34 | 34 |
// Mark the container as having a delete in progress |
| 35 | 35 |
container.SetRemovalInProgress() |
| 36 | 36 |
|
| 37 |
- // Try to remove the container when it's start is removalInProgress. |
|
| 37 |
+ // Try to remove the container when its start is removalInProgress. |
|
| 38 | 38 |
// It should ignore the container and not return an error. |
| 39 | 39 |
if err := daemon.ContainerRm(container.ID, &types.ContainerRmConfig{ForceRemove: true}); err != nil {
|
| 40 | 40 |
t.Fatal(err) |
| ... | ... |
@@ -305,7 +305,7 @@ func (a *Driver) Remove(id string) error {
|
| 305 | 305 |
} |
| 306 | 306 |
|
| 307 | 307 |
// Get returns the rootfs path for the id. |
| 308 |
-// This will mount the dir at it's given path |
|
| 308 |
+// This will mount the dir at its given path |
|
| 309 | 309 |
func (a *Driver) Get(id, mountLabel string) (string, error) {
|
| 310 | 310 |
parents, err := a.getParentLayerPaths(id) |
| 311 | 311 |
if err != nil && !os.IsNotExist(err) {
|
| ... | ... |
@@ -216,7 +216,7 @@ func (d *Driver) Remove(id string) error {
|
| 216 | 216 |
return hcsshim.DestroyLayer(d.info, rID) |
| 217 | 217 |
} |
| 218 | 218 |
|
| 219 |
-// Get returns the rootfs path for the id. This will mount the dir at it's given path. |
|
| 219 |
+// Get returns the rootfs path for the id. This will mount the dir at its given path. |
|
| 220 | 220 |
func (d *Driver) Get(id, mountLabel string) (string, error) {
|
| 221 | 221 |
logrus.Debugf("WindowsGraphDriver Get() id %s mountLabel %s", id, mountLabel)
|
| 222 | 222 |
var dir string |
| ... | ... |
@@ -75,7 +75,7 @@ func (daemon *Daemon) killWithSignal(container *container.Container, sig int) er |
| 75 | 75 |
} |
| 76 | 76 |
|
| 77 | 77 |
// if the container is currently restarting we do not need to send the signal |
| 78 |
- // to the process. Telling the monitor that it should exit on it's next event |
|
| 78 |
+ // to the process. Telling the monitor that it should exit on its next event |
|
| 79 | 79 |
// loop is enough |
| 80 | 80 |
if container.Restarting {
|
| 81 | 81 |
return nil |
| ... | ... |
@@ -90,7 +90,7 @@ Docker image comprising five layers. |
| 90 | 90 |
Digest: sha256:46fb5d001b88ad904c5c732b086b596b92cfb4a4840a3abd0e35dbb6870585e4 |
| 91 | 91 |
Status: Downloaded newer image for ubuntu:latest |
| 92 | 92 |
|
| 93 |
-Each image layer has it's own directory under `/var/lib/docker/overlay/`. This |
|
| 93 |
+Each image layer has its own directory under `/var/lib/docker/overlay/`. This |
|
| 94 | 94 |
is where the contents of each image layer are stored. |
| 95 | 95 |
|
| 96 | 96 |
The output of the command below shows the five directories that store the |
| ... | ... |
@@ -223,7 +223,7 @@ docker exec -it cid3 /bin/sh |
| 223 | 223 |
|
| 224 | 224 |
VLANs (Virtual Local Area Networks) have long been a primary means of virtualizing data center networks and are still in virtually all existing networks today. VLANs work by tagging a Layer-2 isolation domain with a 12-bit identifier ranging from 1-4094 that is inserted into a packet header that enables a logical grouping of a single or multiple subnets of both IPv4 and IPv6. It is very common for network operators to separate traffic using VLANs based on a subnet(s) function or security profile such as `web`, `db` or any other isolation needs. |
| 225 | 225 |
|
| 226 |
-It is very common to have a compute host requirement of running multiple virtual networks concurrently on a host. Linux networking has long supported VLAN tagging, also known by it's standard 802.1q, for maintaining datapath isolation between networks. The Ethernet link connected to a Docker host can be configured to support the 802.1q VLAN IDs, by creating Linux sub-interfaces, each one dedicated to a unique VLAN ID. |
|
| 226 |
+It is very common to have a compute host requirement of running multiple virtual networks concurrently on a host. Linux networking has long supported VLAN tagging, also known by its standard 802.1q, for maintaining datapath isolation between networks. The Ethernet link connected to a Docker host can be configured to support the 802.1q VLAN IDs, by creating Linux sub-interfaces, each one dedicated to a unique VLAN ID. |
|
| 227 | 227 |
|
| 228 | 228 |
 |
| 229 | 229 |
|
| ... | ... |
@@ -4095,7 +4095,7 @@ func (s *DockerSuite) TestRunNonExistingCmd(c *check.C) {
|
| 4095 | 4095 |
|
| 4096 | 4096 |
// TestCmdCannotBeInvoked checks that 'docker run busybox /etc' exits with 126, or |
| 4097 | 4097 |
// 127 on Windows. The difference is that in Windows, the container must be started |
| 4098 |
-// as that's when the check is made (and yes, by it's design...) |
|
| 4098 |
+// as that's when the check is made (and yes, by its design...) |
|
| 4099 | 4099 |
func (s *DockerSuite) TestCmdCannotBeInvoked(c *check.C) {
|
| 4100 | 4100 |
expected := 126 |
| 4101 | 4101 |
if daemonPlatform == "windows" {
|
| ... | ... |
@@ -128,7 +128,7 @@ func (t *testRegistryV2) Close() {
|
| 128 | 128 |
} |
| 129 | 129 |
|
| 130 | 130 |
func (t *testRegistryV2) getBlobFilename(blobDigest digest.Digest) string {
|
| 131 |
- // Split the digest into it's algorithm and hex components. |
|
| 131 |
+ // Split the digest into its algorithm and hex components. |
|
| 132 | 132 |
dgstAlg, dgstHex := blobDigest.Algorithm(), blobDigest.Hex() |
| 133 | 133 |
|
| 134 | 134 |
// The path to the target blob data looks something like: |
| ... | ... |
@@ -103,7 +103,7 @@ func TarResourceRebase(sourcePath, rebaseName string) (content Archive, err erro |
| 103 | 103 |
return |
| 104 | 104 |
} |
| 105 | 105 |
|
| 106 |
- // Separate the source path between it's directory and |
|
| 106 |
+ // Separate the source path between its directory and |
|
| 107 | 107 |
// the entry in that directory which we are archiving. |
| 108 | 108 |
sourceDir, sourceBase := SplitPathDirEntry(sourcePath) |
| 109 | 109 |
|
| ... | ... |
@@ -119,7 +119,7 @@ func (ctx *Ctx) AuthZResponse(rm ResponseModifier, r *http.Request) error {
|
| 119 | 119 |
return nil |
| 120 | 120 |
} |
| 121 | 121 |
|
| 122 |
-// drainBody dump the body (if it's length is less than 1MB) without modifying the request state |
|
| 122 |
+// drainBody dump the body (if its length is less than 1MB) without modifying the request state |
|
| 123 | 123 |
func drainBody(body io.ReadCloser) ([]byte, io.ReadCloser, error) {
|
| 124 | 124 |
bufReader := bufio.NewReaderSize(body, maxBodySize) |
| 125 | 125 |
newBody := ioutils.NewReadCloserWrapper(bufReader, func() error { return body.Close() })
|
| ... | ... |
@@ -31,7 +31,7 @@ func CleanPatterns(patterns []string) ([]string, [][]string, bool, error) {
|
| 31 | 31 |
// Loop over exclusion patterns and: |
| 32 | 32 |
// 1. Clean them up. |
| 33 | 33 |
// 2. Indicate whether we are dealing with any exception rules. |
| 34 |
- // 3. Error if we see a single exclusion marker on it's own (!). |
|
| 34 |
+ // 3. Error if we see a single exclusion marker on its own (!). |
|
| 35 | 35 |
cleanedPatterns := []string{}
|
| 36 | 36 |
patternDirs := [][]string{}
|
| 37 | 37 |
exceptions := false |
| ... | ... |
@@ -89,7 +89,7 @@ func (a *volumeDriverAdapter) getCapabilities() volume.Capability {
|
| 89 | 89 |
if err != nil {
|
| 90 | 90 |
// `GetCapabilities` is a not a required endpoint. |
| 91 | 91 |
// On error assume it's a local-only driver |
| 92 |
- logrus.Warnf("Volume driver %s returned an error while trying to query it's capabilities, using default capabilties: %v", a.name, err)
|
|
| 92 |
+ logrus.Warnf("Volume driver %s returned an error while trying to query its capabilities, using default capabilties: %v", a.name, err)
|
|
| 93 | 93 |
return volume.Capability{Scope: volume.LocalScope}
|
| 94 | 94 |
} |
| 95 | 95 |
|