diff --git a/cmd/podman/kube/play.go b/cmd/podman/kube/play.go index 37ab8cc886..2e21074d02 100644 --- a/cmd/podman/kube/play.go +++ b/cmd/podman/kube/play.go @@ -251,15 +251,6 @@ func play(cmd *cobra.Command, args []string) error { return errors.New("--force may be specified only with --down") } - // When running under Systemd use passthrough as the default log-driver. - // When doing so, the journal socket is passed to the containers as-is which has two advantages: - // 1. journald can see who the actual sender of the log event is, - // rather than thinking everything comes from the conmon process - // 2. conmon will not have to copy all the log data - if !cmd.Flags().Changed(logDriverFlagName) && playOptions.ServiceContainer { - playOptions.LogDriver = define.PassthroughLogging - } - reader, err := readerFromArg(args[0]) if err != nil { return err diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index 87b4777b44..f4da85220f 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -793,6 +793,9 @@ func ConvertKube(kube *parser.UnitFile, isUser bool) (*parser.UnitFile, error) { // Use a service container "--service-container=true", + + // We want output to the journal, so use the log driver. + "--log-driver", "passthrough", ) if err := handleUserRemap(kube, KubeGroup, execStart, isUser, false); err != nil { diff --git a/test/e2e/quadlet/basic.kube b/test/e2e/quadlet/basic.kube index b186efc538..d376e52688 100644 --- a/test/e2e/quadlet/basic.kube +++ b/test/e2e/quadlet/basic.kube @@ -3,6 +3,7 @@ ## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml ## assert-podman-args "--replace" ## assert-podman-args "--service-container=true" +## assert-podman-args "--log-driver" "passthrough" ## assert-podman-stop-args "kube" ## assert-podman-stop-args "down" ## assert-podman-stop-final-args-regex .*/podman_test.*/quadlet/deployment.yml diff --git a/test/e2e/quadlet_test.go b/test/e2e/quadlet_test.go index 257f746fe6..f50f58894e 100644 --- a/test/e2e/quadlet_test.go +++ b/test/e2e/quadlet_test.go @@ -393,6 +393,7 @@ var _ = Describe("quadlet system generator", func() { "## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml", "## assert-podman-args \"--replace\"", "## assert-podman-args \"--service-container=true\"", + "## assert-podman-args \"--log-driver\" \"passthrough\"", "## assert-podman-stop-args \"kube\"", "## assert-podman-stop-args \"down\"", "## assert-podman-stop-final-args-regex .*/podman_test.*/quadlet/deployment.yml", @@ -413,7 +414,7 @@ var _ = Describe("quadlet system generator", func() { "Type=notify", "NotifyAccess=all", "SyslogIdentifier=%N", - fmt.Sprintf("ExecStart=/usr/local/bin/podman kube play --replace --service-container=true %s/deployment.yml", quadletDir), + fmt.Sprintf("ExecStart=/usr/local/bin/podman kube play --replace --service-container=true --log-driver passthrough %s/deployment.yml", quadletDir), fmt.Sprintf("ExecStop=/usr/local/bin/podman kube down %s/deployment.yml", quadletDir), } diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats index 6c00e4dafe..dad551b007 100644 --- a/test/system/250-systemd.bats +++ b/test/system/250-systemd.bats @@ -414,10 +414,10 @@ EOF run_podman 125 container rm $service_container is "$output" "Error: container .* is the service container of pod(s) .* and cannot be removed without removing the pod(s)" - # Verify that the log-driver for the Pod's containers is passthrough + # containers/podman/issues/17482: verify that the log-driver for the Pod's containers is NOT passthrough for name in "a" "b"; do run_podman container inspect test_pod-${name} --format "{{.HostConfig.LogConfig.Type}}" - is $output "passthrough" + assert $output != "passthrough" done # Add a simple `auto-update --dry-run` test here to avoid too much redundancy