[VOL-2312] Logging - Integrate voltctl with new etcd-based dynamic loglevel mechanism. Testing is in progress
Change-Id: I2e13bb79008c9a49ebb6f58e575f51efebe6dbfd
diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/network.go b/vendor/gopkg.in/jcmturner/gokrb5.v7/client/network.go
index 19d25e6..493fb2f 100644
--- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/network.go
+++ b/vendor/gopkg.in/jcmturner/gokrb5.v7/client/network.go
@@ -69,49 +69,47 @@
}
// dialKDCTCP establishes a UDP connection to a KDC.
-func dialKDCUDP(count int, kdcs map[int]string) (conn *net.UDPConn, err error) {
+func dialKDCUDP(count int, kdcs map[int]string) (*net.UDPConn, error) {
i := 1
for i <= count {
- udpAddr, e := net.ResolveUDPAddr("udp", kdcs[i])
- if e != nil {
- err = fmt.Errorf("error resolving KDC address: %v", e)
- return
+ udpAddr, err := net.ResolveUDPAddr("udp", kdcs[i])
+ if err != nil {
+ return nil, fmt.Errorf("error resolving KDC address: %v", err)
}
- conn, err = net.DialUDP("udp", nil, udpAddr)
+
+ conn, err := net.DialTimeout("udp", udpAddr.String(), 5*time.Second)
if err == nil {
- err = conn.SetDeadline(time.Now().Add(5 * time.Second))
- if err != nil {
- return
+ if err := conn.SetDeadline(time.Now().Add(5 * time.Second)); err != nil {
+ return nil, err
}
- return
+ // conn is guaranteed to be a UDPConn
+ return conn.(*net.UDPConn), nil
}
i++
}
- err = errors.New("error in getting a UDP connection to any of the KDCs")
- return
+ return nil, errors.New("error in getting a UDP connection to any of the KDCs")
}
// dialKDCTCP establishes a TCP connection to a KDC.
-func dialKDCTCP(count int, kdcs map[int]string) (conn *net.TCPConn, err error) {
+func dialKDCTCP(count int, kdcs map[int]string) (*net.TCPConn, error) {
i := 1
for i <= count {
- tcpAddr, e := net.ResolveTCPAddr("tcp", kdcs[i])
- if e != nil {
- err = fmt.Errorf("error resolving KDC address: %v", e)
- return
+ tcpAddr, err := net.ResolveTCPAddr("tcp", kdcs[i])
+ if err != nil {
+ return nil, fmt.Errorf("error resolving KDC address: %v", err)
}
- conn, err = net.DialTCP("tcp", nil, tcpAddr)
+
+ conn, err := net.DialTimeout("tcp", tcpAddr.String(), 5*time.Second)
if err == nil {
- err = conn.SetDeadline(time.Now().Add(5 * time.Second))
- if err != nil {
- return
+ if err := conn.SetDeadline(time.Now().Add(5 * time.Second)); err != nil {
+ return nil, err
}
- return
+ // conn is guaranteed to be a TCPConn
+ return conn.(*net.TCPConn), nil
}
i++
}
- err = errors.New("error in getting a TCP connection to any of the KDCs")
- return
+ return nil, errors.New("error in getting a TCP connection to any of the KDCs")
}
// sendKDCUDP sends bytes to the KDC via UDP.
diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/config/krb5conf.go b/vendor/gopkg.in/jcmturner/gokrb5.v7/config/krb5conf.go
index dbc61c3..8efe92d 100644
--- a/vendor/gopkg.in/jcmturner/gokrb5.v7/config/krb5conf.go
+++ b/vendor/gopkg.in/jcmturner/gokrb5.v7/config/krb5conf.go
@@ -119,6 +119,10 @@
// Parse the lines of the [libdefaults] section of the configuration into the LibDefaults struct.
func (l *LibDefaults) parseLines(lines []string) error {
for _, line := range lines {
+ //Remove comments after the values
+ if idx := strings.IndexAny(line, "#;"); idx != -1 {
+ line = line[:idx]
+ }
line = strings.TrimSpace(line)
if line == "" {
continue
@@ -333,6 +337,10 @@
if ignore && c > 0 && !strings.Contains(line, "{") && !strings.Contains(line, "}") {
continue
}
+ //Remove comments after the values
+ if idx := strings.IndexAny(line, "#;"); idx != -1 {
+ line = line[:idx]
+ }
line = strings.TrimSpace(line)
if line == "" {
continue
@@ -407,6 +415,10 @@
var start int
var c int
for i, l := range lines {
+ //Remove comments after the values
+ if idx := strings.IndexAny(l, "#;"); idx != -1 {
+ l = l[:idx]
+ }
l = strings.TrimSpace(l)
if l == "" {
continue
@@ -454,6 +466,10 @@
// Parse the lines of the [domain_realm] section of the configuration and add to the mapping.
func (d *DomainRealm) parseLines(lines []string) error {
for _, line := range lines {
+ //Remove comments after the values
+ if idx := strings.IndexAny(line, "#;"); idx != -1 {
+ line = line[:idx]
+ }
if strings.TrimSpace(line) == "" {
continue
}