Skip to content

Commit

Permalink
Add read/write timeout options for Typha connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
fasaxc committed Aug 29, 2017
1 parent 2993e8c commit e06edc0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 5 additions & 3 deletions config/config_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 4 additions & 0 deletions felix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 5 additions & 4 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import:
- package: k8s.io/client-go
version: 4a3ab2f5be5177366f8206fd79ce55ca80e417fa
- package: github.com/projectcalico/typha
version: ec14f2716227ed72aff32691071f4b450367930a
repo: https://github.com/fasaxc/typha.git
version: add-client-timeout
subpackages:
- pkg/syncclient
- package: github.com/emicklei/go-restful
Expand Down

0 comments on commit e06edc0

Please sign in to comment.