-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[quadlet] add back support for directory symlinks in the podman unit search paths #20504
Comments
Hi @xduugu thanks for bringing this up. The problem is that once Quadlet supports traversing a directory tree, following symlinks may lead to loops (see the reason why it is not supported in I do like the idea of adding directories via the configuration file. @rhatdan @vrothberg WDYT? |
We can't really use I think we should restore the previous behavior as I consider a regression. Couldn't resolve the root directories before recursing/walking it? In this case, we could first resolve If this works and we agree to move forward, the PR fixing it could also make the behavior explicit in the docs. |
If the symlink resolution is only for the root directory, then I guess we can handle it and it will not cause any loops (since it is done only once). Is this the only case we want to support? For this case, I think we can use: https://pkg.go.dev/io/fs#WalkDir |
At least for my use case, root directory symlink support would be sufficient. However, I would somehow prefer smylinks at the first level below the root directory, but that is of course a little bit more complicated to implement. The |
Thanks a lot for the PR, @ygalblum! |
Issue Description
I had symlinked
~/.config/containers/systemd/
to the directory~/containers/quadlet
which worked fine in podman version v4.6.2 and before. My setup broke with podman v4.7.0, because of commit 413552e that added support for unit files in subdirectories.podman/cmd/quadlet/main.go
Lines 148 to 156 in c3fae01
filepath.WalkDir explicitly does not support directory symlinks:
Directory symlinks inside of a directory
~/.config/containers/systemd/
also don't work because of this (and probably theinfo.isDir()
check).Steps to reproduce the issue
Steps to reproduce the issue
~/.config/containers/systemd/
to a directory that contains quadlet unit filesDescribe the results you received
Quadlet does not find the unit files anymore.
Describe the results you expected
Quadlet finds the unit files.
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Instead of adding back support for directory symlinks, it would also help if additional quadlet unit directories could be set via configuration file.
The text was updated successfully, but these errors were encountered: