From 2110422a61fdcf0317ed1b0a02dc1b184392f713 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Fri, 2 Aug 2019 14:02:01 -0400 Subject: Add handling for empty LogDriver There are two cases logdriver can be empty, if it wasn't set by libpod, or if the user did --log-driver "" The latter case is an odd one, and the former is very possible and already handled for LogPath. Instead of printing an error for an entirely reasonable codepath, let's supress the error Signed-off-by: Peter Hunt --- libpod/oci_internal_linux.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libpod/oci_internal_linux.go b/libpod/oci_internal_linux.go index 0bcd021db..52cebefab 100644 --- a/libpod/oci_internal_linux.go +++ b/libpod/oci_internal_linux.go @@ -278,6 +278,10 @@ func (r *OCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, pidPath // No case here should happen except JSONLogging, but keep this here in case the options are extended logrus.Errorf("%s logging specified but not supported. Choosing k8s-file logging instead", ctr.LogDriver()) fallthrough + case "": + // 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 + fallthrough case KubernetesLogging: logDriver = fmt.Sprintf("%s:%s", KubernetesLogging, logPath) } -- cgit v1.2.3-54-g00ecf