From ba62dedc0468f435dcda1e1c7db23a73b1ca2e7e Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Fri, 28 Jan 2022 16:17:37 +0100 Subject: [PATCH 1/2] kv: Tag advanced config parameters Signed-off-by: Arve Knudsen --- kv/client.go | 4 ++-- kv/consul/client.go | 12 ++++++------ kv/etcd/etcd.go | 10 +++++----- kv/multi.go | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/kv/client.go b/kv/client.go index e8f0c6b59..9d471573b 100644 --- a/kv/client.go +++ b/kv/client.go @@ -52,8 +52,8 @@ type StoreConfig struct { // Config is config for a KVStore currently used by ring and HA tracker, // where store can be consul or inmemory. type Config struct { - Store string `yaml:"store"` - Prefix string `yaml:"prefix"` + Store string `yaml:"store" category:"advanced"` + Prefix string `yaml:"prefix" category:"advanced"` StoreConfig `yaml:",inline"` Mock Client `yaml:"-"` diff --git a/kv/consul/client.go b/kv/consul/client.go index 69219cf74..d93f18851 100644 --- a/kv/consul/client.go +++ b/kv/consul/client.go @@ -39,12 +39,12 @@ var ( // Config to create a ConsulClient type Config struct { - Host string `yaml:"host"` - ACLToken string `yaml:"acl_token"` - HTTPClientTimeout time.Duration `yaml:"http_client_timeout"` - ConsistentReads bool `yaml:"consistent_reads"` - WatchKeyRateLimit float64 `yaml:"watch_rate_limit"` // Zero disables rate limit - WatchKeyBurstSize int `yaml:"watch_burst_size"` // Burst when doing rate-limit, defaults to 1 + Host string `yaml:"host" category:"advanced"` + ACLToken string `yaml:"acl_token" category:"advanced"` + HTTPClientTimeout time.Duration `yaml:"http_client_timeout" category:"advanced"` + ConsistentReads bool `yaml:"consistent_reads" category:"advanced"` + WatchKeyRateLimit float64 `yaml:"watch_rate_limit" category:"advanced"` // Zero disables rate limit + WatchKeyBurstSize int `yaml:"watch_burst_size" category:"advanced"` // Burst when doing rate-limit, defaults to 1 // Used in tests only. MaxCasRetries int `yaml:"-"` diff --git a/kv/etcd/etcd.go b/kv/etcd/etcd.go index fa6944d4f..c29a78933 100644 --- a/kv/etcd/etcd.go +++ b/kv/etcd/etcd.go @@ -21,14 +21,14 @@ import ( // Config for a new etcd.Client. type Config struct { - Endpoints []string `yaml:"endpoints"` - DialTimeout time.Duration `yaml:"dial_timeout"` - MaxRetries int `yaml:"max_retries"` + Endpoints []string `yaml:"endpoints" category:"advanced"` + DialTimeout time.Duration `yaml:"dial_timeout" category:"advanced"` + MaxRetries int `yaml:"max_retries" category:"advanced"` EnableTLS bool `yaml:"tls_enabled"` TLS dstls.ClientConfig `yaml:",inline"` - UserName string `yaml:"username"` - Password string `yaml:"password"` + UserName string `yaml:"username" category:"advanced"` + Password string `yaml:"password" category:"advanced"` } // Clientv3Facade is a subset of all Etcd client operations that are required diff --git a/kv/multi.go b/kv/multi.go index 8a3382e98..9a9c24bb8 100644 --- a/kv/multi.go +++ b/kv/multi.go @@ -16,11 +16,11 @@ import ( // MultiConfig is a configuration for MultiClient. type MultiConfig struct { - Primary string `yaml:"primary"` - Secondary string `yaml:"secondary"` + Primary string `yaml:"primary" category:"advanced"` + Secondary string `yaml:"secondary" category:"advanced"` - MirrorEnabled bool `yaml:"mirror_enabled"` - MirrorTimeout time.Duration `yaml:"mirror_timeout"` + MirrorEnabled bool `yaml:"mirror_enabled" category:"advanced"` + MirrorTimeout time.Duration `yaml:"mirror_timeout" category:"advanced"` // ConfigProvider returns channel with MultiRuntimeConfig updates. ConfigProvider func() <-chan MultiRuntimeConfig `yaml:"-"` From 8acfcb2ecaa5ed5fbef94b24609a839f8ad67200 Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Mon, 31 Jan 2022 09:12:44 +0100 Subject: [PATCH 2/2] From feedback, revert some category changes Signed-off-by: Arve Knudsen --- kv/client.go | 2 +- kv/consul/client.go | 2 +- kv/etcd/etcd.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kv/client.go b/kv/client.go index 9d471573b..7131975ee 100644 --- a/kv/client.go +++ b/kv/client.go @@ -52,7 +52,7 @@ type StoreConfig struct { // Config is config for a KVStore currently used by ring and HA tracker, // where store can be consul or inmemory. type Config struct { - Store string `yaml:"store" category:"advanced"` + Store string `yaml:"store"` Prefix string `yaml:"prefix" category:"advanced"` StoreConfig `yaml:",inline"` diff --git a/kv/consul/client.go b/kv/consul/client.go index d93f18851..d278d8c9e 100644 --- a/kv/consul/client.go +++ b/kv/consul/client.go @@ -39,7 +39,7 @@ var ( // Config to create a ConsulClient type Config struct { - Host string `yaml:"host" category:"advanced"` + Host string `yaml:"host"` ACLToken string `yaml:"acl_token" category:"advanced"` HTTPClientTimeout time.Duration `yaml:"http_client_timeout" category:"advanced"` ConsistentReads bool `yaml:"consistent_reads" category:"advanced"` diff --git a/kv/etcd/etcd.go b/kv/etcd/etcd.go index c29a78933..260ac910c 100644 --- a/kv/etcd/etcd.go +++ b/kv/etcd/etcd.go @@ -21,14 +21,14 @@ import ( // Config for a new etcd.Client. type Config struct { - Endpoints []string `yaml:"endpoints" category:"advanced"` + Endpoints []string `yaml:"endpoints"` DialTimeout time.Duration `yaml:"dial_timeout" category:"advanced"` MaxRetries int `yaml:"max_retries" category:"advanced"` EnableTLS bool `yaml:"tls_enabled"` TLS dstls.ClientConfig `yaml:",inline"` - UserName string `yaml:"username" category:"advanced"` - Password string `yaml:"password" category:"advanced"` + UserName string `yaml:"username"` + Password string `yaml:"password"` } // Clientv3Facade is a subset of all Etcd client operations that are required