Bug 2020332

Summary: No events reported when creating pod with --infra=false
Product: Red Hat Enterprise Linux 9 Reporter: Katerina Koukiou <kkoukiou>
Component: podmanAssignee: Charlie Doern <cdoern>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0CC: atomic-bugs, bbaude, cdoern, dwalsh, jligon, jnovy, lsm5, mheon, mmarusak, mpitt, pthomas, tsweeney, umohnani
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2009296 Environment:
Last Closed: 2022-02-08 21:41:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2009296    
Bug Blocks:    

Description Katerina Koukiou 2021-11-04 15:52:06 UTC
+++ This bug was initially created as a clone of Bug #2009296 +++

Description of problem:
In Cockpit CI we updated to new podman 4.0 in rhel-9-0 and now we are not getting any more pod specific events when using --infra=false.

Version-Release number of selected component (if applicable):
podman-3.4.2-0.2.el9.x86_64
containers-common-1-8.el9.noarch

Steps to Reproduce:
1. Start listening on events `curl --unix-socket /run/podman/podman.sock http://d/v1.24/events`
2. Create new pod `podman pod create --infra=false`

Actual results:
No events are reported. If I drop the `--infra=false` then I get 3 events:
```
{"status":"create","id":"6a027d725baac467a62dc0472997a34a2d9cc60dd3d5bdd6f8d1c7a3e81afa7c","from":"k8s.gcr.io/pause:3.5","Type":"container","Action":"create","Actor":{"ID":"6a027d725baac467a62dc0472997a34a2d9cc60dd3d5bdd6f8d1c7a3e81afa7c","Attributes":{"containerExitCode":"0","image":"k8s.gcr.io/pause:3.5","name":"980d9a2e76f0-infra"}},"scope":"local","time":1632995495,"timeNano":1632995495530715340}
{"status":"create","id":"980d9a2e76f07bcdbfb590653b422158ee1c4d93b0fc3a42545ac179ee08d890","Type":"pod","Action":"create","Actor":{"ID":"980d9a2e76f07bcdbfb590653b422158ee1c4d93b0fc3a42545ac179ee08d890","Attributes":{"containerExitCode":"0","image":"","name":"reverent_blackburn"}},"scope":"local","time":1632995495,"timeNano":1632995495531066139}
{"status":"pull","Type":"image","Action":"pull","Actor":{"ID":"","Attributes":{"containerExitCode":"0","image":"","name":"k8s.gcr.io/pause:3.5"}},"scope":"local","time":1632995495,"timeNano":1632995495493199993}
```
The middle one has Type=pod - which should be reported even when --infra=false. 


Expected results:
On previous version doing the same reported:
{"Type":"pod","Action":"create","Actor":{"ID":"d9c732d56a646ff44a38b3d187814bc0d29b6298e1f906a4866be36c121f2bf4","Attributes":{"containerExitCode":"0","image":"","name":"vibrant_shirley"}},"scope":"local","time":1632996219,"timeNano":1632996219213335831}

--- Additional comment from Matthew Heon on 2021-09-30 12:22:48 UTC ---

Charlie, mind taking a quick look at this one?

--- Additional comment from Charlie Doern on 2021-09-30 14:37:55 UTC ---

Yes, I will take a look at this today, probably just needs some rewiring in the libpod api handler for pod creation.

--- Additional comment from Charlie Doern on 2021-09-30 18:29:32 UTC ---

PR opened:

https://github.com/containers/podman/pull/11816

--- Additional comment from Charlie Doern on 2021-10-13 18:18:33 UTC ---

Fixed by PR https://github.com/containers/podman/pull/11816 required movement of pod creation event to a more accessible location.

--- Additional comment from Jindrich Novy on 2021-10-14 08:25:13 UTC ---

Was this backported to v3.4 branch too Charlie? We have podman-3.4 in RHEL-8.6.0.

--- Additional comment from Charlie Doern on 2021-10-25 02:25:23 UTC ---

I am not sure on the backport status, looking at the most recent backports: https://github.com/containers/podman/pull/12040 it does not seem to have made it in @jnovy  Not familiar with the backporting process so I could be missing something here, but to be safe I will ask Matt monday morning

--- Additional comment from Jindrich Novy on 2021-10-25 08:58:35 UTC ---

No problems Charlie, thanks for the commit into the main branch. Matt, do you mind having quick looak at backporting this to v3.4 too?

--- Additional comment from Matthew Heon on 2021-10-26 13:20:41 UTC ---

Sure

Comment 1 Tom Sweeney 2021-11-05 16:56:52 UTC
Assigning to Charlie who addressed the original BZ.

Comment 2 Charlie Doern 2021-11-08 03:27:09 UTC
on my machine with `podman version 4.0.0-dev` running: 

`curl -XPOST --unix-socket /run/user/1000/podman/podman.sock -v -H content-type:application/json http://d/v3.0.0/libpod/pods/create -d '{"name":"foo", "infra":"false"}'`

followed by 

`curl --unix-socket /run/user/1000/podman/podman.sock http://d/v3.0.0/libpod/events?since=2m`

results in an output of:

`{"status":"create","id":"1a165c3232c1e2e05b5618dbb620f41efc0146507d48236e3abf7f167da1c0d3","from":"localhost/podman-pause:4.0.0-dev-1636340683","Type":"container","Action":"create","Actor":{"ID":"1a165c3232c1e2e05b5618dbb620f41efc0146507d48236e3abf7f167da1c0d3","Attributes":{"containerExitCode":"0","image":"localhost/podman-pause:4.0.0-dev-1636340683","io.buildah.version":"1.23.1","name":"edaae17ca5ce-infra"}},"scope":"local","time":1636341766,"timeNano":1636341766990067453}
{"status":"create","id":"edaae17ca5ce5cf3d78172e1abee7e8b5ed72a689e0722f366d750259329c875","Type":"pod","Action":"create","Actor":{"ID":"edaae17ca5ce5cf3d78172e1abee7e8b5ed72a689e0722f366d750259329c875","Attributes":{"containerExitCode":"0","image":"","name":"foo"}},"scope":"local","time":1636341766,"timeNano":1636341766995974539}`

which lists both infra and the pod being created. I am not sure how to go about resolving this, since the issue is identical just on RHEL 9. Is it possible that the version of podman is not up to date with the main branch?

Comment 3 Martin Pitt 2021-11-08 05:20:17 UTC
@Charlie: It's most probably fixed upstream already, but RHEL 9.0 currently has podman-1:3.4.2-0.2.el9.x86_64

Comment 4 Tom Sweeney 2022-02-08 21:41:53 UTC
This has been fixed upstream, tested there, and is present in Podman v4.0 which is targeted for RHEL 8.6.  I'm going to close this as current release.