From 22cde9208bdb335d3b9deddb38e8ee6e0d16abe4 Mon Sep 17 00:00:00 2001 From: Nikos Angelopoulos Date: Thu, 21 Nov 2024 13:38:46 +0100 Subject: [PATCH] Revert "feat: extend kv.client storeconfig to support memberlist flags (#621)" (#622) This reverts commit f9da7284b699e837e2e58cab97b69684084a27a5. --- CHANGELOG.md | 1 - kv/client.go | 8 +++----- kv/client_test.go | 7 ------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d677d5d1c..74844199b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,7 +86,6 @@ * [CHANGE] memberlist: Failure to fast-join a cluster via contacting a node is now logged at `info` instead of `debug`. #585 * [CHANGE] `Service.AddListener` and `Manager.AddListener` now return function for stopping the listener. #564 * [CHANGE] ring: Add `InstanceRingReader` interface to `ring` package. #597 -* [CHANGE] KV: Add `MemberlistKVConfig` at kv `StoreConfig`. Extended `RegisterFlagsWithPrefix` to populate `MemberlistKVConfig` flags with specific prefix. #621 * [FEATURE] Cache: Add support for configuring a Redis cache backend. #268 #271 #276 * [FEATURE] Add support for waiting on the rate limiter using the new `WaitN` method. #279 * [FEATURE] Add `log.BufferedLogger` type. #338 diff --git a/kv/client.go b/kv/client.go index a61f56708..0599f6702 100644 --- a/kv/client.go +++ b/kv/client.go @@ -42,10 +42,9 @@ var ( // Consul, Etcd, Memberlist or MultiClient. It was extracted from Config to keep // single-client config separate from final client-config (with all the wrappers) type StoreConfig struct { - Consul consul.Config `yaml:"consul"` - Etcd etcd.Config `yaml:"etcd"` - MemberlistKVConfig memberlist.KVConfig `yaml:"memberlist"` - Multi MultiConfig `yaml:"multi"` + Consul consul.Config `yaml:"consul"` + Etcd etcd.Config `yaml:"etcd"` + Multi MultiConfig `yaml:"multi"` // Function that returns memberlist.KV store to use. By using a function, we can delay // initialization of memberlist.KV until it is actually required. @@ -75,7 +74,6 @@ func (cfg *Config) RegisterFlagsWithPrefix(flagsPrefix, defaultPrefix string, f cfg.Consul.RegisterFlags(f, flagsPrefix) cfg.Etcd.RegisterFlagsWithPrefix(f, flagsPrefix) cfg.Multi.RegisterFlagsWithPrefix(f, flagsPrefix) - cfg.MemberlistKVConfig.RegisterFlagsWithPrefix(f, flagsPrefix) if flagsPrefix == "" { flagsPrefix = "ring." diff --git a/kv/client_test.go b/kv/client_test.go index 4280765c0..a15adc34e 100644 --- a/kv/client_test.go +++ b/kv/client_test.go @@ -23,10 +23,6 @@ consul: host: "consul:8500" consistentreads: true prefix: "test/" -memberlist: - node_name: "testNode" - randomize_node_name: false - stream_timeout: 3s multi: primary: consul secondary: etcd @@ -39,9 +35,6 @@ multi: require.Equal(t, "consul", cfg.Store) require.Equal(t, "test/", cfg.Prefix) require.Equal(t, "consul:8500", cfg.Consul.Host) - require.Equal(t, "testNode", cfg.MemberlistKVConfig.NodeName) - require.Equal(t, false, cfg.MemberlistKVConfig.RandomizeNodeName) - require.Equal(t, 3*time.Second, cfg.MemberlistKVConfig.StreamTimeout) require.Equal(t, "consul", cfg.Multi.Primary) require.Equal(t, "etcd", cfg.Multi.Secondary) }