-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Give auto-update
ability to use per-container authfile specified by label.
#6188
Give auto-update
ability to use per-container authfile specified by label.
#6188
Conversation
@vrothberg This is basic implementation of functionality I like to have in autoupdate. It is just stripped down version of code referenced in #6159 . I think unit generator changes (arbitrary |
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.
Out of curiosity. Why not use podman auto-update --authfile
instead?
The PR is aiming at each container being able to specify its own auth file for autoupdates. In case they are using the same file, I recommend using --authfile.
Regarding the current implementation. As we are already specifying the auto-update policy via labels, I prefer to add such an authfile via a label as well: io.containers.autoupdate.authfile=/path/auth.json
.
Because, in one quite specific use case, I really want separate authfile for each container, because I have bunch of images in gitlab repo in different namespaces (reasons for this separation are historic and I don't want to mess with it more than necessary) accessible by different credentials (basically this https://gitlab.com/gitlab-org/gitlab/-/issues/22718). I could also create new user to run another rootless podman, but I'd rather not (there is no other gain - services in question share some resources anyway). Alternatively I can just call
where it would use |
Thanks for the details. It makes perfect sense in this context! |
68ff357
to
62642b4
Compare
auto-update
use REGISTRY_AUTH_FILE
from systemd unit.auto-update
use REGISTRY_AUTH_FILE
from systemd unit.
62642b4
to
c82c443
Compare
I still prefer to use Other than that, LGTM. |
auto-update
use REGISTRY_AUTH_FILE
from systemd unit.auto-update
use REGISTRY_AUTH_FILE
from systemd unit.
c82c443
to
61c3822
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: neVERberleRfellerER The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
auto-update
use REGISTRY_AUTH_FILE
from systemd unit.auto-update
use REGISTRY_AUTH_FILE
from systemd unit.
Sorry, I somehow missed the part of your comment suggesting use of label instead of environment variable. I completely agree. |
… label. Signed-off-by: Ondřej Kraus <[email protected]>
61c3822
to
9177c89
Compare
auto-update
use REGISTRY_AUTH_FILE
from systemd unit.auto-update
ability to use per-container authfile specified by label.
I still don't understand why this needs to be a label. Why not
Rather then
Then autoupdate could just look at the authfile associated with the container? If this is not recorded in the containers config, we could start recording it? |
It's possible to get UPDATE: possible authfile-in-config here #6254 |
I am okay with doing that implicitly 👍 Note that it's important to establish a priority over which authfile is being:
|
Ok, I will go along with you guys. |
LGTM, for reference |
Thanks for the great contributions, @neVERberleRfellerER ! |
This makes
podman auto-update
readREGISTRY_AUTH_FILE
environment variable from systemd service unit. It is useful with gitlab container repositories where multiple repositories share same domain but have different deploy tokens.Snippet:
Signed-off-by: Ondřej Kraus [email protected]