Skip to content

Commit

Permalink
Remove deprecated cassandra flags (jaegertracing#2789)
Browse files Browse the repository at this point in the history
* Remove deprecated cassandra flags

Signed-off-by: albertteoh <albert.teoh@logz.io>

* Add breaking changelog entry

Signed-off-by: albertteoh <albert.teoh@logz.io>

* Fix wording; doesn't technically replace

Signed-off-by: albertteoh <albert.teoh@logz.io>
  • Loading branch information
albertteoh authored and bhiravabhatla committed Feb 5, 2021
1 parent 8c29abe commit a636216
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 52 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion pkg/cassandra/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
3 changes: 1 addition & 2 deletions plugin/storage/cassandra/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
48 changes: 16 additions & 32 deletions plugin/storage/cassandra/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
15 changes: 0 additions & 15 deletions plugin/storage/cassandra/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand All @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion plugin/storage/integration/cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a636216

Please sign in to comment.