Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erayarslan committed Nov 13, 2023
1 parent fb999bc commit 3a3480b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions kafka/metadata/kafka_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ func (s *kafkaMetadata) Clear(_ []uint16) error {

func NewKafkaMetadata(
kafkaClient gKafka.Client,
kafkaMetadataConfig map[string]string,
kafkaMetadataConfig map[string]any,
) metadata.Metadata {
var topic string
var partition int
var replicationFactor int

if _, ok := kafkaMetadataConfig["topic"]; ok {
topic = kafkaMetadataConfig["topic"]
topic = kafkaMetadataConfig["topic"].(string)
} else {
panic(errors.New("topic is not defined"))
}
Expand All @@ -152,7 +152,7 @@ func NewKafkaMetadata(
}

if _, ok := kafkaMetadataConfig["partition"]; ok {
partition, _ = strconv.Atoi(kafkaMetadataConfig["partition"])
partition, _ = strconv.Atoi(kafkaMetadataConfig["partition"].(string))
} else {
partition = 25
}
Expand All @@ -162,7 +162,7 @@ func NewKafkaMetadata(
}

if _, ok := kafkaMetadataConfig["replicationFactor"]; ok {
replicationFactor, _ = strconv.Atoi(kafkaMetadataConfig["replicationFactor"])
replicationFactor, _ = strconv.Atoi(kafkaMetadataConfig["replicationFactor"].(string))
} else {
replicationFactor = 3
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestKafka(t *testing.T) {
},
Metadata: dcpConfig.Metadata{
ReadOnly: true,
Config: map[string]string{
Config: map[string]any{
"bucket": "dcp-test",
"scope": "_default",
"collection": "_default",
Expand Down

0 comments on commit 3a3480b

Please sign in to comment.