From a63621696859b26eea7b52b58e680ef11c0dd7ac Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Fri, 5 Feb 2021 16:23:29 +1100 Subject: [PATCH] Remove deprecated cassandra flags (#2789) * Remove deprecated cassandra flags Signed-off-by: albertteoh * Add breaking changelog entry Signed-off-by: albertteoh * Fix wording; doesn't technically replace Signed-off-by: albertteoh --- CHANGELOG.md | 6 ++- pkg/cassandra/config/config.go | 1 - plugin/storage/cassandra/factory_test.go | 3 +- plugin/storage/cassandra/options.go | 48 +++++++------------- plugin/storage/cassandra/options_test.go | 15 ------ plugin/storage/integration/cassandra_test.go | 1 - 6 files changed, 22 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92c02730cff..5ceded5b5c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,10 +18,14 @@ Changes by Version * Remove deprecated flags `--health-check-http-port` & `--admin-http-port`, please use `--admin.http.host-port` ([#2752](https://github.com/jaegertracing/jaeger/pull/2752), [@pradeepnnv](https://github.com/pradeepnnv)) -* Remove deprecated flag `--es.max-num-spans`, please use `--es.max-doc-count` ([#2482](https://github.com/jaegertracing/jaeger/pull/2482),[@BernardTolosajr](https://github.com/BernardTolosajr)) +* Remove deprecated flag `--es.max-num-spans`, please use `--es.max-doc-count` ([#2482](https://github.com/jaegertracing/jaeger/pull/2482), [@BernardTolosajr](https://github.com/BernardTolosajr)) * Remove deprecated flag `--jaeger.tags`, please use `--agent.tags` ([#2753](https://github.com/jaegertracing/jaeger/pull/2753), [@yurishkuro](https://github.com/yurishkuro)) +* Remove deprecated Cassandra flags ([#2789](https://github.com/jaegertracing/jaeger/pull/2789), [@albertteoh](https://github.com/albertteoh)): + * `--cassandra.enable-dependencies-v2` - Jaeger will automatically detect the version of the dependencies table + * `--cassandra.tls.verify-host` - please use `--cassandra.tls.skip-host-verify` instead + #### New Features * Add TLS Support for gRPC and HTTP endpoints of the Query server ([#2337](https://github.com/jaegertracing/jaeger/pull/2337), [#2772](https://github.com/jaegertracing/jaeger/pull/2772), [@rjs211](https://github.com/rjs211)) diff --git a/pkg/cassandra/config/config.go b/pkg/cassandra/config/config.go index c2ea9904cd7..cea7ac0d6e9 100644 --- a/pkg/cassandra/config/config.go +++ b/pkg/cassandra/config/config.go @@ -44,7 +44,6 @@ type Configuration struct { Port int `yaml:"port" mapstructure:"port"` Authenticator Authenticator `yaml:"authenticator" mapstructure:",squash"` DisableAutoDiscovery bool `yaml:"disable_auto_discovery" mapstructure:"-"` - EnableDependenciesV2 bool `yaml:"enable_dependencies_v2" mapstructure:"-"` TLS tlscfg.Options `mapstructure:"tls"` } diff --git a/plugin/storage/cassandra/factory_test.go b/plugin/storage/cassandra/factory_test.go index 26b2d4aea6f..19b523340fb 100644 --- a/plugin/storage/cassandra/factory_test.go +++ b/plugin/storage/cassandra/factory_test.go @@ -55,7 +55,7 @@ func TestCassandraFactory(t *testing.T) { logger, logBuf := testutils.NewLogger() f := NewFactory() v, command := config.Viperize(f.AddFlags) - command.ParseFlags([]string{"--cassandra-archive.enabled=true", "--cassandra.enable-dependencies-v2=true"}) + command.ParseFlags([]string{"--cassandra-archive.enabled=true"}) f.InitFromViper(v) // after InitFromViper, f.primaryConfig points to a real session builder that will fail in unit tests, @@ -109,7 +109,6 @@ func TestExclusiveWhitelistBlacklist(t *testing.T) { f := NewFactory() v, command := config.Viperize(f.AddFlags) command.ParseFlags([]string{"--cassandra-archive.enabled=true", - "--cassandra.enable-dependencies-v2=true", "--cassandra.index.tag-whitelist=a,b,c", "--cassandra.index.tag-blacklist=a,b,c"}) f.InitFromViper(v) diff --git a/plugin/storage/cassandra/options.go b/plugin/storage/cassandra/options.go index 1f51416d68a..ce4dd8dcc1a 100644 --- a/plugin/storage/cassandra/options.go +++ b/plugin/storage/cassandra/options.go @@ -28,25 +28,22 @@ import ( const ( // session settings - suffixEnabled = ".enabled" - suffixConnPerHost = ".connections-per-host" - suffixMaxRetryAttempts = ".max-retry-attempts" - suffixTimeout = ".timeout" - suffixConnectTimeout = ".connect-timeout" - suffixReconnectInterval = ".reconnect-interval" - suffixServers = ".servers" - suffixPort = ".port" - suffixKeyspace = ".keyspace" - suffixDC = ".local-dc" - suffixConsistency = ".consistency" - suffixDisableCompression = ".disable-compression" - suffixProtoVer = ".proto-version" - suffixSocketKeepAlive = ".socket-keep-alive" - suffixUsername = ".username" - suffixPassword = ".password" - suffixEnableDependenciesV2 = ".enable-dependencies-v2" - - suffixVerifyHost = ".tls.verify-host" + suffixEnabled = ".enabled" + suffixConnPerHost = ".connections-per-host" + suffixMaxRetryAttempts = ".max-retry-attempts" + suffixTimeout = ".timeout" + suffixConnectTimeout = ".connect-timeout" + suffixReconnectInterval = ".reconnect-interval" + suffixServers = ".servers" + suffixPort = ".port" + suffixKeyspace = ".keyspace" + suffixDC = ".local-dc" + suffixConsistency = ".consistency" + suffixDisableCompression = ".disable-compression" + suffixProtoVer = ".proto-version" + suffixSocketKeepAlive = ".socket-keep-alive" + suffixUsername = ".username" + suffixPassword = ".password" // common storage settings suffixSpanStoreWriteCacheTTL = ".span-store-write-cache-ttl" @@ -231,14 +228,6 @@ func addFlags(flagSet *flag.FlagSet, nsConfig namespaceConfig) { nsConfig.namespace+suffixPassword, nsConfig.Authenticator.Basic.Password, "Password for password authentication for Cassandra") - flagSet.Bool( - nsConfig.namespace+suffixEnableDependenciesV2, - nsConfig.EnableDependenciesV2, - "(deprecated) Jaeger will automatically detect the version of the dependencies table") - flagSet.Bool( - nsConfig.namespace+suffixVerifyHost, - false, - "(deprecated) Enable (or disable) host key verification. Use "+nsConfig.namespace+".tls.skip-host-verify instead") } // InitFromViper initializes Options with properties from viper @@ -282,13 +271,8 @@ func (cfg *namespaceConfig) initFromViper(v *viper.Viper) { cfg.SocketKeepAlive = v.GetDuration(cfg.namespace + suffixSocketKeepAlive) cfg.Authenticator.Basic.Username = v.GetString(cfg.namespace + suffixUsername) cfg.Authenticator.Basic.Password = v.GetString(cfg.namespace + suffixPassword) - cfg.EnableDependenciesV2 = v.GetBool(cfg.namespace + suffixEnableDependenciesV2) cfg.DisableCompression = v.GetBool(cfg.namespace + suffixDisableCompression) cfg.TLS = tlsFlagsConfig.InitFromViper(v) - - if v.IsSet(cfg.namespace + suffixVerifyHost) { - cfg.TLS.SkipHostVerify = !v.GetBool(cfg.namespace + suffixVerifyHost) - } } // GetPrimary returns primary configuration. diff --git a/plugin/storage/cassandra/options_test.go b/plugin/storage/cassandra/options_test.go index 148cee3700c..822c8377872 100644 --- a/plugin/storage/cassandra/options_test.go +++ b/plugin/storage/cassandra/options_test.go @@ -68,7 +68,6 @@ func TestOptionsWithFlags(t *testing.T) { "--cas-aux.enabled=true", "--cas-aux.keyspace=jaeger-archive", "--cas-aux.servers=3.3.3.3, 4.4.4.4", - "--cas-aux.enable-dependencies-v2=true", }) opts.InitFromViper(v) @@ -77,7 +76,6 @@ func TestOptionsWithFlags(t *testing.T) { assert.Equal(t, "mojave", primary.LocalDC) assert.Equal(t, []string{"1.1.1.1", "2.2.2.2"}, primary.Servers) assert.Equal(t, "ONE", primary.Consistency) - assert.Equal(t, false, primary.EnableDependenciesV2) assert.Equal(t, []string{"blerg", "blarg", "blorg"}, opts.TagIndexBlacklist()) assert.Equal(t, []string{"flerg", "flarg", "florg"}, opts.TagIndexWhitelist()) assert.Equal(t, true, opts.Index.Tags) @@ -96,19 +94,6 @@ func TestOptionsWithFlags(t *testing.T) { assert.Equal(t, "", aux.Consistency, "aux storage does not inherit consistency from primary") assert.Equal(t, 3, aux.ProtoVersion) assert.Equal(t, 42*time.Second, aux.SocketKeepAlive) - assert.Equal(t, true, aux.EnableDependenciesV2) -} - -func TestDeprecatedTlsHostVerifyFlagShouldBeRespected(t *testing.T) { - opts := NewOptions("cas") - v, command := config.Viperize(opts.AddFlags) - command.ParseFlags([]string{ - "--cas.tls.verify-host=false", - }) - opts.InitFromViper(v) - - primary := opts.GetPrimary() - assert.Equal(t, true, primary.TLS.SkipHostVerify) } func TestDefaultTlsHostVerify(t *testing.T) { diff --git a/plugin/storage/integration/cassandra_test.go b/plugin/storage/integration/cassandra_test.go index fe5983667ae..a1375993fe8 100644 --- a/plugin/storage/integration/cassandra_test.go +++ b/plugin/storage/integration/cassandra_test.go @@ -87,7 +87,6 @@ func (s *CassandraStorageIntegration) initializeCassandra() error { func (s *CassandraStorageIntegration) initializeCassandraDependenciesV2() error { f, err := s.initializeCassandraFactory([]string{ "--cassandra.keyspace=jaeger_v1_dc1", - "--cassandra.enable-dependencies-v2=true", "--cassandra.port=9043", }) if err != nil {