Skip to content

Commit

Permalink
Merge pull request #18178 from ygalblum/quadlet-log-driver
Browse files Browse the repository at this point in the history
Quadlet - do not set log-driver by default
  • Loading branch information
openshift-merge-robot authored Apr 13, 2023
2 parents c8eb151 + 4aced7e commit ca3876c
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 15 deletions.
4 changes: 0 additions & 4 deletions docs/source/markdown/podman-systemd.unit.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ This key can be listed multiple times.
Set the log-driver Podman should use when running the container.
Equivalent to the Podman `--log-driver` option.

The default value is `passthrough`.

### `Mount=`

Attach a filesystem mount to the container.
Expand Down Expand Up @@ -488,8 +486,6 @@ This key may be used multiple times
Set the log-driver Podman should use when running the container.
Equivalent to the Podman `--log-driver` option.

The default value is `passthrough`.

### `Network=`

Specify a custom network for the container. This has the same format as the `--network` option
Expand Down
8 changes: 2 additions & 6 deletions pkg/systemd/quadlet/quadlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ const (
XKubeGroup = "X-Kube"
XNetworkGroup = "X-Network"
XVolumeGroup = "X-Volume"

// Use passthough as the default log driver to output to Journal
defaultLogDriver = "passthrough"
)

// All the supported quadlet keys
Expand Down Expand Up @@ -1108,10 +1105,9 @@ func handlePublishPorts(unitFile *parser.UnitFile, groupName string, podman *Pod

func handleLogDriver(unitFile *parser.UnitFile, groupName string, podman *PodmanCmdline) {
logDriver, found := unitFile.Lookup(groupName, KeyLogDriver)
if !found {
logDriver = defaultLogDriver
if found {
podman.add("--log-driver", logDriver)
}
podman.add("--log-driver", logDriver)
}

func handleStorageSource(quadletUnitFile, serviceUnitFile *parser.UnitFile, source string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/quadlet/basepodman.container
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## assert-podman-final-args run --name=systemd-%N --cidfile=%t/%N.cid --replace --rm --log-driver passthrough --cgroups=split --sdnotify=conmon -d localhost/imagename
## assert-podman-final-args run --name=systemd-%N --cidfile=%t/%N.cid --replace --rm --cgroups=split --sdnotify=conmon -d localhost/imagename

[Container]
Image=localhost/imagename
Expand Down
1 change: 0 additions & 1 deletion test/e2e/quadlet/basic.container
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
## assert-podman-args "--rm"
## assert-podman-args "--replace"
## assert-podman-args "-d"
## assert-podman-args "--log-driver" "passthrough"
## assert-podman-args "--cgroups=split"
## assert-podman-args "--sdnotify=conmon"
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
Expand Down
1 change: 0 additions & 1 deletion test/e2e/quadlet/basic.kube
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## 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
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/quadlet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ 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",
Expand All @@ -496,7 +495,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 --log-driver passthrough %s/deployment.yml", quadletDir),
fmt.Sprintf("ExecStart=/usr/local/bin/podman kube play --replace --service-container=true %s/deployment.yml", quadletDir),
fmt.Sprintf("ExecStop=/usr/local/bin/podman kube down %s/deployment.yml", quadletDir),
}

Expand Down
1 change: 1 addition & 0 deletions test/system/252-quadlet.bats
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ EOF
Image=$IMAGE
Exec=sh -c "echo OUTPUT: \"\$FOOBAR\" \"\$BAR\""
Environment="FOOBAR=Foo Bar" BAR=bar
LogDriver=passthrough
EOF

run_quadlet "$quadlet_file"
Expand Down

0 comments on commit ca3876c

Please sign in to comment.