Browse code

Merge pull request #21613 from wzyboy/support-unixgram-syslog-address

Support unixgram syslog address

Brian Goff authored on 2016/04/29 00:06:17
Showing 4 changed files
... ...
@@ -163,8 +163,8 @@ func parseAddress(address string) (string, string, error) {
163 163
 		return "", "", err
164 164
 	}
165 165
 
166
-	// unix socket validation
167
-	if url.Scheme == "unix" {
166
+	// unix and unixgram socket validation
167
+	if url.Scheme == "unix" || url.Scheme == "unixgram" {
168 168
 		if _, err := os.Stat(url.Path); err != nil {
169 169
 			return "", "", err
170 170
 		}
... ...
@@ -74,6 +74,7 @@ The following logging options are supported for the `syslog` logging driver:
74 74
 
75 75
     --log-opt syslog-address=[tcp|udp|tcp+tls]://host:port
76 76
     --log-opt syslog-address=unix://path
77
+    --log-opt syslog-address=unixgram://path
77 78
     --log-opt syslog-facility=daemon
78 79
     --log-opt syslog-tls-ca-cert=/etc/ca-certificates/custom/ca.pem
79 80
     --log-opt syslog-tls-cert=/etc/ca-certificates/custom/cert.pem
... ...
@@ -11,7 +11,7 @@ var (
11 11
 	validPrefixes = map[string][]string{
12 12
 		"url":       {"http://", "https://"},
13 13
 		"git":       {"git://", "github.com/", "git@"},
14
-		"transport": {"tcp://", "tcp+tls://", "udp://", "unix://"},
14
+		"transport": {"tcp://", "tcp+tls://", "udp://", "unix://", "unixgram://"},
15 15
 	}
16 16
 	urlPathWithFragmentSuffix = regexp.MustCompile(".git(?:#.+)?$")
17 17
 )
... ...
@@ -23,6 +23,7 @@ var (
23 23
 		"tcp+tls://example.com",
24 24
 		"udp://example.com",
25 25
 		"unix:///example",
26
+		"unixgram:///example",
26 27
 	}
27 28
 )
28 29