Merged
Conversation
d57e912 to
ff6896a
Compare
thaJeztah
previously approved these changes
Dec 1, 2020
Member
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM
left questions w.r.t. the Windows changes (change doesn't really affect current code, but perhaps we need a tracking issue for it and/or remove the windows code altogether?)
fd78c12 to
bada950
Compare
TBBle
previously approved these changes
Dec 3, 2020
AkihiroSuda
previously approved these changes
Dec 3, 2020
> libcontainer/cgroups/utils.go:282:4: SA4006: this value of `paths` is never used (staticcheck) > paths = make(map[string]string) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Commit 4415446 introduces this function which is never used. Remove it. This fixes > libcontainer/container_linux.go:1813:26: func `(*linuxContainer).deleteState` is unused (unused) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This fixes the following warnings: > libcontainer/integration/exec_test.go:369:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple) > outputStatus := string(stdout.Bytes()) > ^ > libcontainer/integration/exec_test.go:422:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple) > outputStatus := string(stdout.Bytes()) > ^ > libcontainer/integration/exec_test.go:486:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple) > outputGroups := string(stdout.Bytes()) > ^ > libcontainer/integration/execin_test.go:191:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple) > outputGroups := string(stdout.Bytes()) > ^ > libcontainer/integration/execin_test.go:474:9: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple) > out := string(stdout.Bytes()) > ^ Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
... use the one from unix instead. Coincidentally, this fixes this warning from gosimple linter: > libcontainer/integration/exec_test.go:448:2: S1021: should merge variable declaration with assignment on next line (gosimple) > var netAdminBit uint > ^ Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> libcontainer/container_linux.go:683:2: S1021: should merge variable declaration with assignment on next line (gosimple) > var t criurpc.CriuReqType > ^ Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> libcontainer/container_linux.go:768:2: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix` (gosimple)
> if strings.HasPrefix(mountDest, c.config.Rootfs) {
> ^
> libcontainer/container_linux.go:1150:2: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix` (gosimple)
> if strings.HasPrefix(mountDest, c.config.Rootfs) {
> ^
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> libcontainer/intelrdt/monitoring.go:24:2: SA5001: should check returned error before deferring file.Close() (staticcheck) > defer file.Close() > ^ Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
bada950 to
9792929
Compare
Contributor
Author
|
As per conversation in moby/moby#41746 (comment), I separated out the windows part of this to #2700. |
mrunalp
approved these changes
Dec 4, 2020
AkihiroSuda
approved these changes
Dec 4, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes some sensible linter warnings, and silence a few that do not make much sense. Please see individual commits for details.
With this other PRs (#2694, #2696, #2700), we are down to 3 warnings (plus a lot of
errcheckones which are to be addressed separately):The protobuf one needs coordinated changes in go-criu (cc @adrianreber).
The ebfp one is related to cilium/ebpf@5727d65 and probably cilium/ebpf#110
Related to #2627