-
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
Include annotations in events #24467
Comments
Unfortunately with our event log design (file or journal) we must print all the container information on each event so we write a lot of duplicated information there which causes a lot of log churn. As such I rather not do that, we already have lots of complains about the log churn as we do include labels. If we include annotations as well we make this even worse |
Thank you for your reactivity. By the way, I do not see the labels either in the output from If labels were part of the output from |
The labels all get merged into Attributes, not really perfect I know. The event struct is a bit of a mess. I don't know why it ended up like that, maybe docker compat?! |
FWIW, I tried to use OCI hooks instead, but stumbled across issues there as well for my particular use case. For reference, this is the full picture of what I'm trying to achieve:
This is as far as I got using hooks:
|
Feature request description
Hello,
I have some code that listens to podman events (using
podman events --stream --output json --no-trunc
) and reacts to certain events.The code needs to behave differently based on annotations associated with the objects (pod in my case but the same could be true for containers).
Currently, annotations are not included in the events, meaning that a separate command must be used to retrieve them, which causes other issues (e.g. race conditions).
Suggest potential solution
Include annotations associated with an object in events generated for that object.
Have you considered any alternatives?
Alternative solution : retrieve the annotations separately using
podman inspect <object>
.However, doing so runs into a race condition where the object may have already disappeared (e.g. when running a short-lived pod or container to do a task) and the annotations cannot be retrieved.
Additional context
Tested on podman version 4.9.4.
The text was updated successfully, but these errors were encountered: