libct/cgroup/utils: fix GetCgroupMounts(all=true)#2689
Merged
AkihiroSuda merged 1 commit intoopencontainers:masterfrom Dec 8, 2020
Merged
libct/cgroup/utils: fix GetCgroupMounts(all=true)#2689AkihiroSuda merged 1 commit intoopencontainers:masterfrom
AkihiroSuda merged 1 commit intoopencontainers:masterfrom
Conversation
437b09c to
3b74547
Compare
AkihiroSuda
previously approved these changes
Nov 24, 2020
Member
|
@mrunalp PTAL |
The `all` argument was introduced by commit f557996 specifically for use by cAdvisor (see [1]), but there were no test cases added, so it was later broken by 5ee0648 which started incrementing numFound unconditionally. Fix this (by not checking numFound in case all is true), and add a simple test case to avoid future regressions. [1] google/cadvisor#1476 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
3b74547 to
7cd062d
Compare
Contributor
Author
|
Rebased to include new CI checks; no changes to the code |
AkihiroSuda
approved these changes
Dec 2, 2020
Contributor
|
LGTM. But i also don't see why cadvisor needs to use |
dqminh
approved these changes
Dec 7, 2020
Contributor
Author
It's complicated :-\ I tried to get rid of it but I'm afraid of re-introducing google/cadvisor#1461 |
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.
The
allargument was introduced by commit f557996 (PR #1049) specificallyfor use by cAdvisor (see google/cadvisor#1476), but there were no test cases added,
so it was later accidentally broken by 5ee0648 (#1817) which started incrementing
numFoundunconditionally.Fix this (by not checking
numFoundwhenallis true), and add asimple test case to avoid future regressions.
PS It appears to be that cadvisor is the only user of
all=truefunctionality.If we could eliminate it, we would remove
all=trueentirely, but it's not clearhow to do that. I sincerely hope one day cgroup v1 is going away entirely,
including all this code.