@@ -23,16 +23,16 @@ import (
2323 "strings"
2424 "time"
2525
26+ "github.com/golang/glog"
2627 "k8s.io/apimachinery/pkg/util/wait"
2728
28- "github.com/golang/glog"
2929 "github.com/k8snetworkplumbingwg/ovs-cni/pkg/cache"
3030 "github.com/k8snetworkplumbingwg/ovs-cni/pkg/marker"
3131)
3232
3333const (
3434 UnixSocketType = "unix"
35- TcpSocketType = "tcp"
35+ TCPSocketType = "tcp"
3636 SocketConnectionTimeout = time .Minute
3737)
3838
@@ -98,7 +98,6 @@ func main() {
9898 if err != nil {
9999 glog .Fatalf ("Update failed: %v" , err )
100100 }
101-
102101 }, time .Duration (* updateInterval )* time .Second , 1.2 , true , wait .NeverStop )
103102}
104103
@@ -119,7 +118,6 @@ func keepAlive(healthCheckFile string, healthCheckInterval int) {
119118 healthCheckFile , err )
120119 }
121120 }
122-
123121 }, time .Duration (healthCheckInterval )* time .Second )
124122}
125123
@@ -140,7 +138,7 @@ func parseOvsSocket(ovsSocket *string) (string, string, error) {
140138 address = * ovsSocket
141139 } else {
142140 socketType = ovsSocketTokens [0 ]
143- if socketType == TcpSocketType {
141+ if socketType == TCPSocketType {
144142 if len (ovsSocketTokens ) != 3 {
145143 return "" , "" , fmt .Errorf ("failed to parse OVS %s socket, must be in this format %s:<host>:<port>" , socketType , socketType )
146144 }
@@ -166,8 +164,8 @@ func getOvsSocketValidator(socketType string) (func(string) error, error) {
166164 switch socketType {
167165 case UnixSocketType :
168166 return validateOvsUnixConnection , nil
169- case TcpSocketType :
170- return validateOvsTcpConnection , nil
167+ case TCPSocketType :
168+ return validateOvsTCPConnection , nil
171169 default :
172170 return nil , fmt .Errorf ("unsupported ovs socket type: %s" , socketType )
173171 }
@@ -189,8 +187,8 @@ func validateOvsUnixConnection(address string) error {
189187 return nil
190188}
191189
192- func validateOvsTcpConnection (address string ) error {
193- conn , err := net .DialTimeout (TcpSocketType , address , SocketConnectionTimeout )
190+ func validateOvsTCPConnection (address string ) error {
191+ conn , err := net .DialTimeout (TCPSocketType , address , SocketConnectionTimeout )
194192 if err == nil {
195193 glog .Info ("Successfully connected to TCP socket" )
196194 conn .Close ()
0 commit comments