Stop depending on github.com/opencontainers/runc#785
Merged
Conversation
We only use a single 9-line function, so replace that with a local (and improved) version. This will allow us to remove the dependency on runc, and avoid the bureaucy of investigating and documenting how we (don't need to) handle unrelated vulnerabilities in that codebase. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Member
|
ELN job failure is odd. Don't see that on other recent PRs, nor on skopeo. Maybe a retrigger would solve it if it matters. |
Contributor
Author
|
For peace of mind, I did re-run the ELN job and it passed. |
kolyshkin
reviewed
Apr 24, 2026
| if err != nil { | ||
| return false | ||
| } | ||
| return len(buf) >= 1 && buf[0] == 'Y' |
Contributor
There was a problem hiding this comment.
nit: I'd simplify that to len(buf) > 0.
Contributor
Author
There was a problem hiding this comment.
FWIW compilers routinely make these kinds of optimizations nowadays: https://godbolt.org/z/Yv1GrKEYE .
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.
We only use a single 9-line function, so replace that with a local (and improved) version.
This will allow us to remove the dependency on runc, and avoid the bureaucy of investigating and documenting how we (don't need to) handle unrelated vulnerabilities in that codebase.
Cc: @kolyshkin @TomSweeneyRedHat
Following up on #781 . There is also a caller in Buildah (potentially benefiting from making the new function public), I’ll leave that one to others, incl. the decision whether the code should live in c/common or Buildah proper.