From ae8eec8d8e7cff97dcbd6c253269c3e84a888c27 Mon Sep 17 00:00:00 2001 From: Shaun Crampton Date: Tue, 29 Aug 2017 16:11:16 +0100 Subject: [PATCH] Add read/write timeout options for Typha connection. --- config/config_params.go | 8 +++++--- felix.go | 4 ++++ glide.lock | 8 ++++---- glide.yaml | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/config/config_params.go b/config/config_params.go index bc564382c4..a7c5a3eb2b 100644 --- a/config/config_params.go +++ b/config/config_params.go @@ -102,9 +102,11 @@ type Config struct { EtcdCaFile string `config:"file(must-exist);;local"` EtcdEndpoints []string `config:"endpoint-list;;local"` - TyphaAddr string `config:"authority;;"` - TyphaK8sServiceName string `config:"string;"` - TyphaK8sNamespace string `config:"string;kube-system;non-zero"` + TyphaAddr string `config:"authority;;"` + TyphaK8sServiceName string `config:"string;"` + TyphaK8sNamespace string `config:"string;kube-system;non-zero"` + TyphaReadTimeout time.Duration `config:"seconds;30"` + TyphaWriteTimeout time.Duration `config:"seconds;10"` Ipv6Support bool `config:"bool;true"` IgnoreLooseRPF bool `config:"bool;false"` diff --git a/felix.go b/felix.go index 769a0f4969..11b2db283b 100644 --- a/felix.go +++ b/felix.go @@ -346,6 +346,10 @@ configRetry: fmt.Sprintf("Revision: %s; Build date: %s", buildinfo.GitRevision, buildinfo.BuildDate), syncerToValidator, + &syncclient.Options{ + ReadTimeout: configParams.TyphaReadTimeout, + WriteTimeout: configParams.TyphaWriteTimeout, + }, ) } else { // Use the syncer locally. diff --git a/glide.lock b/glide.lock index a69a51cb25..2060ddb29a 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: da8a8061d5ca9db1b8820c6b289a116a0875436650a1c6cd98cd8edbe511a450 -updated: 2017-08-21T15:51:25.351367412Z +hash: 39ba300daf8dda15ad8269ff852cdb269445961ef9038e603456171973f8d6cf +updated: 2017-08-30T10:08:02.364264565Z imports: - name: cloud.google.com/go version: 3b1ae45394a234c385be014e9a488f2bb6eef821 @@ -186,7 +186,7 @@ imports: - lib/testutils - lib/validator - name: github.com/projectcalico/typha - version: ec14f2716227ed72aff32691071f4b450367930a + version: 71413e6c4e8f903f899429329cf3e38e17633ba5 subpackages: - pkg/syncclient - pkg/syncproto @@ -254,7 +254,7 @@ imports: - jws - jwt - name: golang.org/x/sys - version: 07c182904dbd53199946ba614a412c61d3c548f5 + version: ab9e364efd8b52800ff7ee48a9ffba4e0ed78dfb subpackages: - unix - name: golang.org/x/text diff --git a/glide.yaml b/glide.yaml index 787e85087c..cba3bf78ff 100644 --- a/glide.yaml +++ b/glide.yaml @@ -44,7 +44,7 @@ import: - package: k8s.io/client-go version: 4a3ab2f5be5177366f8206fd79ce55ca80e417fa - package: github.com/projectcalico/typha - version: ec14f2716227ed72aff32691071f4b450367930a + version: 0.4.1 subpackages: - pkg/syncclient - package: github.com/emicklei/go-restful