-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
etcd_docker 2: Add a docker based etcdintegration package
PR 2 for #4144 High level approach is as described in #4144 . This PR adds: - Functions to spin up a 1 node etcd cluster using docker (in `dockerexternal`) - A drop in replacement for the etcd/integration package using `dockerexternal` commit-id:e4e80f1d
- Loading branch information
1 parent
bdd86b8
commit 6dacbc5
Showing
15 changed files
with
1,263 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/aggregator/integration/one_client_multi_type_untimed_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build integration | ||
//go:build integration | ||
|
||
// Copyright (c) 2016 Uber Technologies, Inc. | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,22 @@ import ( | |
|
||
// ClusterConfig is the config for a zoned etcd cluster. | ||
type ClusterConfig struct { | ||
Zone string `yaml:"zone"` | ||
Endpoints []string `yaml:"endpoints"` | ||
KeepAlive *KeepAliveConfig `yaml:"keepAlive"` | ||
TLS *TLSConfig `yaml:"tls"` | ||
AutoSyncInterval time.Duration `yaml:"autoSyncInterval"` | ||
DialTimeout time.Duration `yaml:"dialTimeout"` | ||
Zone string `yaml:"zone"` | ||
Endpoints []string `yaml:"endpoints"` | ||
KeepAlive *KeepAliveConfig `yaml:"keepAlive"` | ||
TLS *TLSConfig `yaml:"tls"` | ||
// AutoSyncInterval configures the etcd client's AutoSyncInterval | ||
// (go.etcd.io/etcd/client/[email protected]/config.go:32). | ||
// By default, it is 1m. | ||
// | ||
// Advanced: | ||
// | ||
// One important difference from the etcd config: we have autosync *on* by default (unlike etcd), meaning that | ||
// the zero value here doesn't indicate autosync off. | ||
// Instead, users should pass in a negative value to indicate "disable autosync" | ||
// Only do this if you truly have a good reason for it! Most production use cases want autosync on. | ||
AutoSyncInterval time.Duration `yaml:"autoSyncInterval"` | ||
DialTimeout time.Duration `yaml:"dialTimeout"` | ||
|
||
DialOptions []grpc.DialOption `yaml:"-"` // nonserializable | ||
} | ||
|
@@ -59,7 +69,10 @@ func (c ClusterConfig) NewCluster() Cluster { | |
SetKeepAliveOptions(keepAliveOpts). | ||
SetTLSOptions(c.TLS.newOptions()) | ||
|
||
if c.AutoSyncInterval > 0 { | ||
// Autosync should *always* be on, unless the user very explicitly requests it to be off. They can do this via a | ||
// negative value (in which case we can assume they know what they're doing). | ||
// Therefore, only update if it's nonzero, on the assumption that zero is just the empty value. | ||
if c.AutoSyncInterval != 0 { | ||
cluster = cluster.SetAutoSyncInterval(c.AutoSyncInterval) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.