Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay committed Mar 24, 2020
1 parent b184206 commit c7bbb97
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/opentelemetry-collector/app/exporter/kafka/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const (
TypeStr = "jaeger_kafka"
)

// OptionsFactory returns initialized es.OptionsFactory structure.
// OptionsFactory returns initialized kafka.Options structure.
type OptionsFactory func() *kafka.Options

// DefaultOptions creates Kadka options supported by this exporter.
// DefaultOptions creates Kafka options supported by this exporter.
func DefaultOptions() *kafka.Options {
return &kafka.Options{}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ import (

func TestCreateTraceExporter(t *testing.T) {
v, _ := jConfig.Viperize(DefaultOptions().AddFlags)
opts := DefaultOptions()
opts.InitFromViper(v)
factory := &Factory{OptionsFactory: func() *kafka.Options {
opts := DefaultOptions()
opts.InitFromViper(v)
return opts
}}
exporter, err := factory.CreateTraceExporter(zap.NewNop(), factory.CreateDefaultConfig())
require.Nil(t, exporter)
assert.EqualError(t, err, "kafka: client has run out of available brokers to talk to (Is your cluster reachable?)")
}

exporter, err = factory.CreateTraceExporter(zap.NewNop(), nil)
func TestCreateTraceExporter_nilConfig(t *testing.T) {
factory := &Factory{}
exporter, err := factory.CreateTraceExporter(zap.NewNop(), nil)
require.Nil(t, exporter)
assert.EqualError(t, err, "could not cast configuration to jaeger_kafka")
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kafka/auth/kerberos.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
type KerberosConfig struct {
ServiceName string `mapstructure:"service_name"`
Realm string `mapstructure:"realm"`
UseKeyTab bool `mapstructure:"use_key_tab"`
UseKeyTab bool `mapstructure:"use_keytab"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
ConfigPath string `mapstructure:"config_file"`
KeyTabPath string `mapstructure:"key_tab_file"`
KeyTabPath string `mapstructure:"keytab_file"`
}

func setKerberosConfiguration(config *KerberosConfig, saramaConfig *sarama.Config) {
Expand Down

0 comments on commit c7bbb97

Please sign in to comment.