mirror of https://github.com/containers/podman.git
conmon: silence json-file error
We should just silently fall through. The log was flooding the system-service logs when running Gitlab runner. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
parent
8e88abda85
commit
15188dce05
|
@ -1354,8 +1354,6 @@ func (r *ConmonOCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, p
|
||||||
logDriverArg = define.NoLogging
|
logDriverArg = define.NoLogging
|
||||||
case define.PassthroughLogging:
|
case define.PassthroughLogging:
|
||||||
logDriverArg = define.PassthroughLogging
|
logDriverArg = define.PassthroughLogging
|
||||||
case define.JSONLogging:
|
|
||||||
fallthrough
|
|
||||||
//lint:ignore ST1015 the default case has to be here
|
//lint:ignore ST1015 the default case has to be here
|
||||||
default: //nolint:stylecheck,gocritic
|
default: //nolint:stylecheck,gocritic
|
||||||
// No case here should happen except JSONLogging, but keep this here in case the options are extended
|
// No case here should happen except JSONLogging, but keep this here in case the options are extended
|
||||||
|
@ -1365,6 +1363,8 @@ func (r *ConmonOCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, p
|
||||||
// to get here, either a user would specify `--log-driver ""`, or this came from another place in libpod
|
// to get here, either a user would specify `--log-driver ""`, or this came from another place in libpod
|
||||||
// since the former case is obscure, and the latter case isn't an error, let's silently fallthrough
|
// since the former case is obscure, and the latter case isn't an error, let's silently fallthrough
|
||||||
fallthrough
|
fallthrough
|
||||||
|
case define.JSONLogging:
|
||||||
|
fallthrough
|
||||||
case define.KubernetesLogging:
|
case define.KubernetesLogging:
|
||||||
logDriverArg = fmt.Sprintf("%s:%s", define.KubernetesLogging, logPath)
|
logDriverArg = fmt.Sprintf("%s:%s", define.KubernetesLogging, logPath)
|
||||||
}
|
}
|
||||||
|
|
|
@ -376,17 +376,7 @@ json-file | f
|
||||||
while read driver do_check; do
|
while read driver do_check; do
|
||||||
msg=$(random_string 15)
|
msg=$(random_string 15)
|
||||||
run_podman run --name myctr --log-driver $driver $IMAGE echo $msg
|
run_podman run --name myctr --log-driver $driver $IMAGE echo $msg
|
||||||
|
is "$output" "$msg" "basic output sanity check (driver=$driver)"
|
||||||
# Simple output check
|
|
||||||
# Special case: 'json-file' emits a warning, the rest do not
|
|
||||||
# ...but with podman-remote the warning is on the server only
|
|
||||||
if [[ $do_check == 'f' ]] && ! is_remote; then # 'f' for 'fallback'
|
|
||||||
is "${lines[0]}" ".* level=error msg=\"json-file logging specified but not supported. Choosing k8s-file logging instead\"" \
|
|
||||||
"Fallback warning emitted"
|
|
||||||
is "${lines[1]}" "$msg" "basic output sanity check (driver=$driver)"
|
|
||||||
else
|
|
||||||
is "$output" "$msg" "basic output sanity check (driver=$driver)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Simply confirm that podman preserved our argument as-is
|
# Simply confirm that podman preserved our argument as-is
|
||||||
run_podman inspect --format '{{.HostConfig.LogConfig.Type}}' myctr
|
run_podman inspect --format '{{.HostConfig.LogConfig.Type}}' myctr
|
||||||
|
|
Loading…
Reference in New Issue