From feb90346e0da7ca7f046ffd0150fdc9805aec2e7 Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Fri, 7 Sep 2018 11:37:40 +0800 Subject: [PATCH] doc: fix typo Signed-off-by: Yan Zhu --- contrib/completions/bash/runc | 2 +- libcontainer/cgroups/fs/cpuset.go | 2 +- libcontainer/cgroups/fs/stats_util_test.go | 2 +- libcontainer/cgroups/utils.go | 6 +++--- libcontainer/container_linux_test.go | 2 +- libcontainer/intelrdt/intelrdt.go | 2 +- libcontainer/nsenter/nsexec.c | 2 +- libcontainer/process_linux.go | 2 +- libcontainer/stacktrace/capture_test.go | 2 +- signals.go | 2 +- tests/integration/events.bats | 2 +- tests/integration/helpers.bash | 2 +- tests/integration/update.bats | 2 +- tty.go | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contrib/completions/bash/runc b/contrib/completions/bash/runc index c2d0a3a15..7f6adc72a 100644 --- a/contrib/completions/bash/runc +++ b/contrib/completions/bash/runc @@ -73,7 +73,7 @@ __runc_to_extglob() { # continue processing its completion. # # TODO if the preceding command has options that accept arguments and an -# argument is equal ot one of the subcommands, this is falsely detected as +# argument is equal to one of the subcommands, this is falsely detected as # a match. __runc_subcommands() { local subcommands="$1" diff --git a/libcontainer/cgroups/fs/cpuset.go b/libcontainer/cgroups/fs/cpuset.go index 20c9eafac..a1f496871 100644 --- a/libcontainer/cgroups/fs/cpuset.go +++ b/libcontainer/cgroups/fs/cpuset.go @@ -77,7 +77,7 @@ func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) erro // The logic is, if user specified cpuset configs, use these // specified configs, otherwise, inherit from parent. This makes // cpuset configs work correctly with 'cpuset.cpu_exclusive', and - // keep backward compatbility. + // keep backward compatibility. if err := s.ensureCpusAndMems(dir, cgroup); err != nil { return err } diff --git a/libcontainer/cgroups/fs/stats_util_test.go b/libcontainer/cgroups/fs/stats_util_test.go index ba0a53e46..c5a8d1858 100644 --- a/libcontainer/cgroups/fs/stats_util_test.go +++ b/libcontainer/cgroups/fs/stats_util_test.go @@ -86,7 +86,7 @@ func expectMemoryStatEquals(t *testing.T, expected, actual cgroups.MemoryStats) expectMemoryDataEquals(t, expected.KernelUsage, actual.KernelUsage) if expected.UseHierarchy != actual.UseHierarchy { - logrus.Printf("Expected memory use hiearchy %v, but found %v\n", expected.UseHierarchy, actual.UseHierarchy) + logrus.Printf("Expected memory use hierarchy %v, but found %v\n", expected.UseHierarchy, actual.UseHierarchy) t.Fail() } diff --git a/libcontainer/cgroups/utils.go b/libcontainer/cgroups/utils.go index 7c995efee..122a47924 100644 --- a/libcontainer/cgroups/utils.go +++ b/libcontainer/cgroups/utils.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "github.com/docker/go-units" + units "github.com/docker/go-units" ) const ( @@ -103,7 +103,7 @@ func FindCgroupMountpointDir() (string, error) { } if postSeparatorFields[0] == "cgroup" { - // Check that the mount is properly formated. + // Check that the mount is properly formatted. if numPostFields < 3 { return "", fmt.Errorf("Error found less than 3 fields post '-' in %q", text) } @@ -262,7 +262,7 @@ func getCgroupPathHelper(subsystem, cgroup string) (string, error) { } // This is needed for nested containers, because in /proc/self/cgroup we - // see pathes from host, which don't exist in container. + // see paths from host, which don't exist in container. relCgroup, err := filepath.Rel(root, cgroup) if err != nil { return "", err diff --git a/libcontainer/container_linux_test.go b/libcontainer/container_linux_test.go index e90b4b5e4..594c3b724 100644 --- a/libcontainer/container_linux_test.go +++ b/libcontainer/container_linux_test.go @@ -159,7 +159,7 @@ func TestGetContainerStats(t *testing.T) { t.Fatal("cgroup stats are nil") } if stats.CgroupStats.MemoryStats.Usage.Usage != 1024 { - t.Fatalf("expected memory usage 1024 but recevied %d", stats.CgroupStats.MemoryStats.Usage.Usage) + t.Fatalf("expected memory usage 1024 but received %d", stats.CgroupStats.MemoryStats.Usage.Usage) } if intelrdt.IsEnabled() { if stats.IntelRdtStats == nil { diff --git a/libcontainer/intelrdt/intelrdt.go b/libcontainer/intelrdt/intelrdt.go index 487c630af..6ddf2031e 100644 --- a/libcontainer/intelrdt/intelrdt.go +++ b/libcontainer/intelrdt/intelrdt.go @@ -177,7 +177,7 @@ func findIntelRdtMountpointDir() (string, error) { } if postSeparatorFields[0] == "resctrl" { - // Check that the mount is properly formated. + // Check that the mount is properly formatted. if numPostFields < 3 { return "", fmt.Errorf("Error found less than 3 fields post '-' in %q", text) } diff --git a/libcontainer/nsenter/nsexec.c b/libcontainer/nsenter/nsexec.c index a4cd1399d..cb2243147 100644 --- a/libcontainer/nsenter/nsexec.c +++ b/libcontainer/nsenter/nsexec.c @@ -211,7 +211,7 @@ static int try_mapping_tool(const char *app, int pid, char *map, size_t map_len) /* * If @app is NULL, execve will segfault. Just check it here and bail (if - * we're in this path, the caller is already getting desparate and there + * we're in this path, the caller is already getting desperate and there * isn't a backup to this failing). This usually would be a configuration * or programming issue. */ diff --git a/libcontainer/process_linux.go b/libcontainer/process_linux.go index 58980b059..cc94c69f3 100644 --- a/libcontainer/process_linux.go +++ b/libcontainer/process_linux.go @@ -537,7 +537,7 @@ func (p *Process) InitializeIO(rootuid, rootgid int) (i *IO, err error) { } fds = append(fds, r.Fd(), w.Fd()) p.Stderr, i.Stderr = w, r - // change ownership of the pipes incase we are in a user namespace + // change ownership of the pipes in case we are in a user namespace for _, fd := range fds { if err := unix.Fchown(int(fd), rootuid, rootgid); err != nil { return nil, err diff --git a/libcontainer/stacktrace/capture_test.go b/libcontainer/stacktrace/capture_test.go index 18ca924ee..978f6c408 100644 --- a/libcontainer/stacktrace/capture_test.go +++ b/libcontainer/stacktrace/capture_test.go @@ -19,7 +19,7 @@ func TestCaptureTestFunc(t *testing.T) { // the first frame is the caller frame := stack.Frames[0] if expected := "captureFunc"; frame.Function != expected { - t.Fatalf("expected function %q but recevied %q", expected, frame.Function) + t.Fatalf("expected function %q but received %q", expected, frame.Function) } expected := "/runc/libcontainer/stacktrace" if !strings.HasSuffix(frame.Package, expected) { diff --git a/signals.go b/signals.go index 1811de837..de9477427 100644 --- a/signals.go +++ b/signals.go @@ -29,7 +29,7 @@ func newSignalHandler(enableSubreaper bool, notifySocket *notifySocket) *signalH } } // ensure that we have a large buffer size so that we do not miss any signals - // incase we are not processing them fast enough. + // in case we are not processing them fast enough. s := make(chan os.Signal, signalBufferSize) // handle all signals for the process. signal.Notify(s) diff --git a/tests/integration/events.bats b/tests/integration/events.bats index 2ae814704..b3e6315b5 100644 --- a/tests/integration/events.bats +++ b/tests/integration/events.bats @@ -36,7 +36,7 @@ function teardown() { # spawn two sub processes (shells) # the first sub process is an event logger that sends stats events to events.log - # the second sub process waits for an event that incudes test_busybox then + # the second sub process waits for an event that includes test_busybox then # kills the test_busybox container which causes the event logger to exit (__runc events test_busybox > events.log) & ( diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index 99d48b7ba..da7a98c58 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -121,7 +121,7 @@ function set_cgroups_path() { sed -i 's/\("linux": {\)/\1\n "cgroupsPath": "\/runc-cgroups-integration-test\/test-cgroup",/' "$bundle/config.json" } -# Helper function to set a resouces limit +# Helper function to set a resources limit function set_resources_limit() { bundle="${1:-.}" sed -i 's/\("linux": {\)/\1\n "resources": { "pids": { "limit": 100 } },/' "$bundle/config.json" diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 702c1e031..fca5a27b3 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -123,7 +123,7 @@ function check_cgroup_value() { [ "$status" -eq 0 ] check_cgroup_value $CGROUP_MEMORY "memory.soft_limit_in_bytes" 33554432 - # Run swap memory tests if swap is avaialble + # Run swap memory tests if swap is available if [ -f "$CGROUP_MEMORY/memory.memsw.limit_in_bytes" ]; then # try to remove memory swap limit runc update test_update --memory-swap -1 diff --git a/tty.go b/tty.go index c8d01ebe3..ddfd4c5ad 100644 --- a/tty.go +++ b/tty.go @@ -135,7 +135,7 @@ func (t *tty) ClosePostStart() error { return nil } -// Close closes all open fds for the tty and/or restores the orignal +// Close closes all open fds for the tty and/or restores the original // stdin state to what it was prior to the container execution func (t *tty) Close() error { // ensure that our side of the fds are always closed