@@ -267,6 +267,29 @@ var _ = Describe("Verify podman containers.conf usage", func() {
267267 Expect (out ).To (ContainSubstring ("alpine" ))
268268 })
269269
270+ It ("using journald for container with container log_tag override" , func () {
271+ SkipIfJournaldUnavailable ()
272+ os .Setenv ("CONTAINERS_CONF" , "config/containers-journald.conf" )
273+ if IsRemote () {
274+ podmanTest .RestartRemoteService ()
275+ }
276+ logc := podmanTest .Podman ([]string {"run" , "-d" , "--log-opt" , "tag=OverriddenTag" , ALPINE , "sh" , "-c" , "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman" })
277+ logc .WaitWithDefaultTimeout ()
278+ Expect (logc ).Should (ExitCleanly ())
279+ cid := logc .OutputToString ()
280+
281+ wait := podmanTest .Podman ([]string {"wait" , cid })
282+ wait .WaitWithDefaultTimeout ()
283+ Expect (wait ).Should (ExitCleanly ())
284+
285+ // Flake prevention: journalctl makes no timeliness guarantees.
286+ time .Sleep (1 * time .Second )
287+ cmd := exec .Command ("journalctl" , "--no-pager" , "-o" , "json" , "--output-fields=CONTAINER_TAG" , fmt .Sprintf ("CONTAINER_ID_FULL=%s" , cid ))
288+ out , err := cmd .CombinedOutput ()
289+ Expect (err ).ToNot (HaveOccurred ())
290+ Expect (out ).To (ContainSubstring ("OverriddenTag" ))
291+ })
292+
270293 It ("add volumes" , func () {
271294 conffile := filepath .Join (podmanTest .TempDir , "container.conf" )
272295
0 commit comments