podman events --filter machine=... fails with "MACHINE is an invalid filter"
Issue Description
Machine is a defined event type in Podman representing Podman Machine VM lifecycle events (start, stop, init, remove).
However, attempting to filter the event stream specifically by machine name or VM ID using podman events --filter machine=<vm-name> returns an error: Error: MACHINE is an invalid filter.
Upon checking the codebase:
events.Machine("machine") is explicitly defined inlibpod/events/config.go.events.Machine.String()is exposed under--filter type=machinein shell completion (cmd/podman/common/completion.go).- However, filtering directly by machine attributes via
--filter machine=...fails becausegenerateEventFilterinlibpod/events/filters.golacks acase "MACHINE":handler, and shell autocompletion incmd/podman/common/completion.golacks"machine="mapping.
Steps to reproduce the issue
- Initialize or query a podman machine: $ podman machine init
- Try to stream events filtered by machine name: $ podman events --filter machine=podman-machine-default
- Observe the command failure.
Describe the results you received
Error: MACHINE is an invalid filter
Describe the results you expected
podman events --filter machine=podman-machine-default should filter and display events matching the machine name without throwing an invalid filter error, consistent with --filter container=..., --filter image=..., --filter pod=..., --filter volume=..., --filter secret=..., and --filter network=....
podman info output
host:
arch: amd64
buildDaemon: true
cgroupControllers:
- cpu
- io
- memory
- pids
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.1.10-1.fc40.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.1.10, commit: '
cpus: 8
distribution:
distribution: ubuntu
version: "24.04"
ociRuntime:
name: crun
package: crun-1.14.4-1.fc40.x86_64
path: /usr/bin/crun
version: crun version 1.14.4
os: linux
store:
configFile: /home/user/.config/containers/storage.conf
containerStore:
number: 0
graphDriverName: overlay
graphOptions: {}
graphRoot: /home/user/.local/share/containers/storage
graphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
imageCopyTmpDir: /tmp
imageStore:
number: 0
runRoot: /run/user/1000/containers
volumeStore:
number: 0
version:
APIVersion: 5.0.0
Built: 0
BuiltTime: Thu Jan 1 00:00:00 1970
GitCommit: ""
GoVersion: go1.22.2
Os: linux
OsArch: linux/amd64
Version: 5.1.0-dev
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Reproduced on Linux / WSL2 Ubuntu 24.04 environment running upstream development build of Podman.
Additional information
Code references:
libpod/events/config.go: DefinesMachine Type = "machine".libpod/events/filters.go:generateEventFilter()handlesCONTAINER,IMAGE,ARTIFACT,POD,VOLUME,NETWORK,SECRET,TYPE,LABEL, but is missingcase "MACHINE":.cmd/podman/common/completion.go:keyValueCompletionis missing"machine=".
machine events are quite different and do not use the libpod event logger otherwise so podman events will never show machine events AFAICT. Therefore it should not accept machine filters.
Thanks for clarifying the architectural boundary @Luap99 ! That makes complete sense—since machine events are managed out-of-band and do not write to the libpod event logger, podman events should not accept machine filters.
Closing this issue.