-
Notifications
You must be signed in to change notification settings - Fork 435
Fix ldcache update when host and container distributions do not match #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
/cherry-pick release-1.18 |
9a32323 to
fb95f58
Compare
aa0c6fa to
a854d3d
Compare
cdesiniotis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of comments / questions, but no blockers.
2794eaa to
0b28791
Compare
internal/ldconfig/ldconfig.go
Outdated
| func (l *Ldconfig) getSystemSerachPaths() []string { | ||
| func (l *Ldconfig) getSystemSearchPaths() []string { | ||
| if l.isDebianLikeContainer { | ||
| debianSystemSearchPaths() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been debugging issues on my homelab cluster with the latest CTK release, and I just spotted this code here. I think it's missing a return. I can send a PR for the existing code, or we can roll that fix into this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1457
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. In order to minimize backport churn, let's add the commit to this PR.
f432507 to
70cca03
Compare
|
I'm preparing a follow up / alternative to this patch to handle additional cases I've ran into recently. Should have it out as a branch in an hour or so. |
7f73f39 to
22d7b5d
Compare
This change ensures that updating the ldcache in a container also includes the system search paths for the container ldconfig. In most cases, the hook will be executing a host ldconfig that may be configured widely differently from what the container image expects. The common case is Debian vs non-Debian. But there are also hosts that configure ldconfig to search in a glibc prefix (e.g. /usr/lib/glibc). To avoid all these cases, write the container's expected system search paths to a drop-in conf file that is likely to be last in lexicographic order. Entries in the top-level ld.so.conf file may be processed after this drop-in, but this hook does not modify the top-level file if it exists. Signed-off-by: Jean-Francois Roy <[email protected]> Signed-off-by: Evan Lezar <[email protected]>
22d7b5d to
d3dcb86
Compare
This change fixes the update of the ldcache when running a non-debian (including ubuntu) container on a debian-like system. Here the ldcache in the container does not initially include system libraries from
/lib64or/usr/lib64since thisldconfigfrom the host that is executed in the container's namespace does not process those paths by default.This is related to #1403 and will need to be updated once that is merged since we would also need to NOT include
lib64and/usr/lib64in the list of folders if it's already present in the config folders for some reason.Testing
The expected behaviour when using
runcdirectly:The current behaviour:
(note that
libc.so.6is not present in the ldcache since/lib64(linked to/usr/lib64) is not processed).The updated behaviour: