diff --git a/pkg/daemons/executor/executor.go b/pkg/daemons/executor/executor.go index 1a6d24d006..6b71b8cd4a 100644 --- a/pkg/daemons/executor/executor.go +++ b/pkg/daemons/executor/executor.go @@ -42,25 +42,29 @@ type Executor interface { CRIReadyChan() <-chan struct{} } +type ETCDSocketOpts struct { + ReuseAddress bool `json:"reuse-address,omitempty"` + ReusePort bool `json:"reuse-port,omitempty"` +} + type ETCDConfig struct { InitialOptions `json:",inline"` - Name string `json:"name,omitempty"` - ListenClientURLs string `json:"listen-client-urls,omitempty"` - ListenClientHTTPURLs string `json:"listen-client-http-urls,omitempty"` - ListenMetricsURLs string `json:"listen-metrics-urls,omitempty"` - ListenPeerURLs string `json:"listen-peer-urls,omitempty"` - AdvertiseClientURLs string `json:"advertise-client-urls,omitempty"` - DataDir string `json:"data-dir,omitempty"` - SnapshotCount int `json:"snapshot-count,omitempty"` - ServerTrust ServerTrust `json:"client-transport-security"` - PeerTrust PeerTrust `json:"peer-transport-security"` - ForceNewCluster bool `json:"force-new-cluster,omitempty"` - ReuseAddress bool `json:"reuse-address,omitempty"` - ReusePort bool `json:"reuse-port,omitempty"` - HeartbeatInterval int `json:"heartbeat-interval"` - ElectionTimeout int `json:"election-timeout"` - Logger string `json:"logger"` - LogOutputs []string `json:"log-outputs"` + Name string `json:"name,omitempty"` + ListenClientURLs string `json:"listen-client-urls,omitempty"` + ListenClientHTTPURLs string `json:"listen-client-http-urls,omitempty"` + ListenMetricsURLs string `json:"listen-metrics-urls,omitempty"` + ListenPeerURLs string `json:"listen-peer-urls,omitempty"` + AdvertiseClientURLs string `json:"advertise-client-urls,omitempty"` + DataDir string `json:"data-dir,omitempty"` + SnapshotCount int `json:"snapshot-count,omitempty"` + ServerTrust ServerTrust `json:"client-transport-security"` + PeerTrust PeerTrust `json:"peer-transport-security"` + ForceNewCluster bool `json:"force-new-cluster,omitempty"` + HeartbeatInterval int `json:"heartbeat-interval"` + ElectionTimeout int `json:"election-timeout"` + Logger string `json:"logger"` + LogOutputs []string `json:"log-outputs"` + SocketOpts ETCDSocketOpts `json:"socket-options"` ExperimentalInitialCorruptCheck bool `json:"experimental-initial-corrupt-check"` ExperimentalWatchProgressNotifyInterval time.Duration `json:"experimental-watch-progress-notify-interval"` diff --git a/pkg/etcd/etcd.go b/pkg/etcd/etcd.go index ac5c8970f2..eb54455ebe 100644 --- a/pkg/etcd/etcd.go +++ b/pkg/etcd/etcd.go @@ -1035,10 +1035,11 @@ func (e *ETCD) cluster(ctx context.Context, reset bool, options executor.Initial HeartbeatInterval: 500, Logger: "zap", LogOutputs: []string{"stderr"}, - ReuseAddress: true, - ReusePort: true, ListenClientHTTPURLs: e.listenClientHTTPURLs(), - + SocketOpts: executor.ETCDSocketOpts{ + ReuseAddress: true, + ReusePort: true, + }, ExperimentalInitialCorruptCheck: true, ExperimentalWatchProgressNotifyInterval: e.config.Datastore.NotifyInterval, }, e.config.ExtraEtcdArgs, e.Test) @@ -1101,13 +1102,14 @@ func (e *ETCD) StartEmbeddedTemporary(ctx context.Context) error { ListenPeerURLs: peerURL, Logger: "zap", LogOutputs: []string{"stderr"}, - ReuseAddress: true, - ReusePort: true, HeartbeatInterval: 500, ElectionTimeout: 5000, SnapshotCount: 10000, Name: e.name, - + SocketOpts: executor.ETCDSocketOpts{ + ReuseAddress: true, + ReusePort: true, + }, ExperimentalInitialCorruptCheck: true, ExperimentalWatchProgressNotifyInterval: e.config.Datastore.NotifyInterval, }, append(e.config.ExtraEtcdArgs, "--max-snapshots=0", "--max-wals=0"), e.Test)