mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Quadlet - do not set log-driver by default
Update e2e tests not to expect the flag System tests - explicitly set the log driver to be able to parse the output Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
@ -295,8 +295,6 @@ This key can be listed multiple times.
|
|||||||
Set the log-driver Podman should use when running the container.
|
Set the log-driver Podman should use when running the container.
|
||||||
Equivalent to the Podman `--log-driver` option.
|
Equivalent to the Podman `--log-driver` option.
|
||||||
|
|
||||||
The default value is `passthrough`.
|
|
||||||
|
|
||||||
### `Mount=`
|
### `Mount=`
|
||||||
|
|
||||||
Attach a filesystem mount to the container.
|
Attach a filesystem mount to the container.
|
||||||
@ -488,8 +486,6 @@ This key may be used multiple times
|
|||||||
Set the log-driver Podman should use when running the container.
|
Set the log-driver Podman should use when running the container.
|
||||||
Equivalent to the Podman `--log-driver` option.
|
Equivalent to the Podman `--log-driver` option.
|
||||||
|
|
||||||
The default value is `passthrough`.
|
|
||||||
|
|
||||||
### `Network=`
|
### `Network=`
|
||||||
|
|
||||||
Specify a custom network for the container. This has the same format as the `--network` option
|
Specify a custom network for the container. This has the same format as the `--network` option
|
||||||
|
@ -27,9 +27,6 @@ const (
|
|||||||
XKubeGroup = "X-Kube"
|
XKubeGroup = "X-Kube"
|
||||||
XNetworkGroup = "X-Network"
|
XNetworkGroup = "X-Network"
|
||||||
XVolumeGroup = "X-Volume"
|
XVolumeGroup = "X-Volume"
|
||||||
|
|
||||||
// Use passthough as the default log driver to output to Journal
|
|
||||||
defaultLogDriver = "passthrough"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// All the supported quadlet keys
|
// All the supported quadlet keys
|
||||||
@ -1108,11 +1105,10 @@ func handlePublishPorts(unitFile *parser.UnitFile, groupName string, podman *Pod
|
|||||||
|
|
||||||
func handleLogDriver(unitFile *parser.UnitFile, groupName string, podman *PodmanCmdline) {
|
func handleLogDriver(unitFile *parser.UnitFile, groupName string, podman *PodmanCmdline) {
|
||||||
logDriver, found := unitFile.Lookup(groupName, KeyLogDriver)
|
logDriver, found := unitFile.Lookup(groupName, KeyLogDriver)
|
||||||
if !found {
|
if found {
|
||||||
logDriver = defaultLogDriver
|
|
||||||
}
|
|
||||||
podman.add("--log-driver", logDriver)
|
podman.add("--log-driver", logDriver)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func handleStorageSource(quadletUnitFile, serviceUnitFile *parser.UnitFile, source string) (string, error) {
|
func handleStorageSource(quadletUnitFile, serviceUnitFile *parser.UnitFile, source string) (string, error) {
|
||||||
if source[0] == '.' {
|
if source[0] == '.' {
|
||||||
|
@ -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]
|
[Container]
|
||||||
Image=localhost/imagename
|
Image=localhost/imagename
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
## assert-podman-args "--rm"
|
## assert-podman-args "--rm"
|
||||||
## assert-podman-args "--replace"
|
## assert-podman-args "--replace"
|
||||||
## assert-podman-args "-d"
|
## assert-podman-args "-d"
|
||||||
## assert-podman-args "--log-driver" "passthrough"
|
|
||||||
## assert-podman-args "--cgroups=split"
|
## assert-podman-args "--cgroups=split"
|
||||||
## assert-podman-args "--sdnotify=conmon"
|
## assert-podman-args "--sdnotify=conmon"
|
||||||
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
||||||
## assert-podman-args "--replace"
|
## assert-podman-args "--replace"
|
||||||
## assert-podman-args "--service-container=true"
|
## assert-podman-args "--service-container=true"
|
||||||
## assert-podman-args "--log-driver" "passthrough"
|
|
||||||
## assert-podman-stop-args "kube"
|
## assert-podman-stop-args "kube"
|
||||||
## assert-podman-stop-args "down"
|
## assert-podman-stop-args "down"
|
||||||
## assert-podman-stop-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
## assert-podman-stop-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
||||||
|
@ -475,7 +475,6 @@ var _ = Describe("quadlet system generator", func() {
|
|||||||
"## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml",
|
"## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml",
|
||||||
"## assert-podman-args \"--replace\"",
|
"## assert-podman-args \"--replace\"",
|
||||||
"## assert-podman-args \"--service-container=true\"",
|
"## assert-podman-args \"--service-container=true\"",
|
||||||
"## assert-podman-args \"--log-driver\" \"passthrough\"",
|
|
||||||
"## assert-podman-stop-args \"kube\"",
|
"## assert-podman-stop-args \"kube\"",
|
||||||
"## assert-podman-stop-args \"down\"",
|
"## assert-podman-stop-args \"down\"",
|
||||||
"## assert-podman-stop-final-args-regex .*/podman_test.*/quadlet/deployment.yml",
|
"## assert-podman-stop-final-args-regex .*/podman_test.*/quadlet/deployment.yml",
|
||||||
@ -496,7 +495,7 @@ var _ = Describe("quadlet system generator", func() {
|
|||||||
"Type=notify",
|
"Type=notify",
|
||||||
"NotifyAccess=all",
|
"NotifyAccess=all",
|
||||||
"SyslogIdentifier=%N",
|
"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),
|
fmt.Sprintf("ExecStop=/usr/local/bin/podman kube down %s/deployment.yml", quadletDir),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +177,7 @@ EOF
|
|||||||
Image=$IMAGE
|
Image=$IMAGE
|
||||||
Exec=sh -c "echo OUTPUT: \"\$FOOBAR\" \"\$BAR\""
|
Exec=sh -c "echo OUTPUT: \"\$FOOBAR\" \"\$BAR\""
|
||||||
Environment="FOOBAR=Foo Bar" BAR=bar
|
Environment="FOOBAR=Foo Bar" BAR=bar
|
||||||
|
LogDriver=passthrough
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
run_quadlet "$quadlet_file"
|
run_quadlet "$quadlet_file"
|
||||||
|
Reference in New Issue
Block a user