summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/options.go b/libpod/options.go
index d6eb97609..20aa51981 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -985,10 +985,12 @@ func WithLogDriver(driver string) CtrCreateOption {
if ctr.valid {
return ErrCtrFinalized
}
- if driver == "" {
+ switch driver {
+ case "":
return errors.Wrapf(ErrInvalidArg, "log driver must be set")
- }
- if driver != "journald" && driver != "k8s-file" && driver != "json-file" {
+ case JournaldLogging, KubernetesLogging, JSONLogging:
+ break
+ default:
return errors.Wrapf(ErrInvalidArg, "invalid log driver")
}