Commit Graph

5 Commits

Author SHA1 Message Date
Kir Kolyshkin e6048715e4 Use gofumpt to format code
gofumpt (mvdan.cc/gofumpt) is a fork of gofmt with stricter rules.

Brought to you by

	git ls-files \*.go | grep -v ^vendor/ | xargs gofumpt -s -w

Looking at the diff, all these changes make sense.

Also, replace gofmt with gofumpt in golangci.yml.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-06-01 12:17:27 -07:00
SataQiu abcc1aae05 fix some typos about libcontainer
Signed-off-by: SataQiu <1527062125@qq.com>
2020-10-17 13:14:55 +08:00
Kir Kolyshkin 619de9773e libct/cg/fscommon_test: rm cgroups dependency
This removes package dependency on cgroup, as following commits
make cgroup use fscommon, which would result in dependency cycle.

The code to find out memory cgroup root is not really needed,
as 99% of test envrionments will have it at /sys/fs/cgroup/memory.
If not, that means we're either on cgroupv2 or on some very custom
system, so just skip the test.

The code that checks if we're on cgroupv2 is replaced by the check
of the particular v1 control file.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-05 14:07:15 -07:00
Mario Nitchev 648295be98 Skip test for cgroups v2
Signed-off-by: Yulia Nedyalkova <julianedialkova@hotmail.com>
2020-03-19 12:54:54 +02:00
Danail Branekov f34eb2c003 Retry writing to cgroup files on EINTR error
Golang 1.14 introduces asynchronous preemption which results into
applications getting frequent EINTR (syscall interrupted) errors when
invoking slow syscalls, e.g. when writing to cgroup files.

As writing to cgroups is idempotent, it is safe to retry writing to the
file whenever the write syscall is interrupted.

Signed-off-by: Mario Nitchev <marionitchev@gmail.com>
2020-03-18 13:00:05 +02:00