Skip to content

events: include labels in pod and volume attributes Fixes: #26480#28879

Open
jiwahn wants to merge 1 commit into
podman-container-tools:mainfrom
jiwahn:fix-event-attributes-labels
Open

events: include labels in pod and volume attributes Fixes: #26480#28879
jiwahn wants to merge 1 commit into
podman-container-tools:mainfrom
jiwahn:fix-event-attributes-labels

Conversation

@jiwahn

@jiwahn jiwahn commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

 Pod and volume events now include labels in the JSON `Attributes` field, consistent with container events.

Description

Volume events currently do not include labels in the event Attributes field, even though the labels are present in volume inspect output. Container events already include labels in Attributes, so this change aligns volume and pod events with that behavior.

For journald-backed volume events, labels also need to be explicitly written to and read from PODMAN_LABELS; otherwise, labels are lost when events are reconstructed from journald.

This also fixes exec_died event construction so the execID attribute is preserved together with container labels instead of being overwritten.

Related Issues

Fixes #26480

Changes

  • libpod/events.go:

    • Adds volume labels to volume event Attributes.
    • Adds pod labels to pod event Attributes.
    • Updates exec_died event construction to merge container labels with execID so execID is not overwritten.
  • libpod/events/journal_linux.go:

    • Writes volume event labels to PODMAN_LABELS when using the journald event backend.
    • Restores volume event labels from PODMAN_LABELS when reading events from journald.
  • test/system/090-events.bats:

    • Extends the volume events test to verify that volume labels are included in JSON event Attributes.
    • Adds a system test for pod labels in JSON event Attributes.

@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small nits.

Comment thread libpod/events.go Outdated
Comment thread test/system/090-events.bats Outdated
@jiwahn jiwahn force-pushed the fix-event-attributes-labels branch 2 times, most recently from 6f831f1 to 16549b7 Compare June 9, 2026 03:00
@jiwahn

jiwahn commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@Honny1 you are right. I made changes accordingly. Thanks for the review

@jiwahn jiwahn requested a review from Honny1 June 9, 2026 03:05

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

PTAL @podman-container-tools/podman-reviewers @podman-container-tools/podman-maintainers

@giuseppe giuseppe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe

giuseppe commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

please put "Fixes..." in the commit message on a separate line

@inknos

inknos commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

please put "Fixes..." in the commit message on a separate line

we could turn it in an automatic check

LGTM after the commit fix

Fixes: podman-container-tools#26480

Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
@jiwahn jiwahn force-pushed the fix-event-attributes-labels branch from 16549b7 to ef2d2e4 Compare June 9, 2026 11:36
@Honny1

Honny1 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

please put "Fixes..." in the commit message on a separate line

we could turn it in an automatic check

I am not sure about this. Not all commits need to contain fixes.

@inknos

inknos commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

please put "Fixes..." in the commit message on a separate line

we could turn it in an automatic check

I am not sure about this. Not all commits need to contain fixes.

I mean if Fixes: link is in the subject we could catch it. I've seen it sometimes

@Honny1 Honny1 enabled auto-merge June 10, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Volume events do not include Attributes

4 participants