mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
orchestrator/kafka: force metadata refresh during tests
New versions of kadm cache metadata by default. Ask a refresh to avoid that.
This commit is contained in:
@@ -82,6 +82,7 @@ func (c *Component) Start() error {
|
||||
return fmt.Errorf("unable to create topic %q: %w", c.kafkaTopic, err)
|
||||
}
|
||||
l.Info().Msg("topic created")
|
||||
client.ForceMetadataRefresh()
|
||||
} else {
|
||||
nbPartitions := len(topic.Partitions)
|
||||
if nbPartitions > int(c.config.TopicConfiguration.NumPartitions) {
|
||||
@@ -95,6 +96,7 @@ func (c *Component) Start() error {
|
||||
c.kafkaTopic, err)
|
||||
}
|
||||
l.Info().Msg("number of partitions increased")
|
||||
client.ForceMetadataRefresh()
|
||||
}
|
||||
if int(c.config.TopicConfiguration.ReplicationFactor) != topic.Partitions.NumReplicas() {
|
||||
// TODO: https://github.com/deviceinsight/kafkactl/blob/main/internal/topic/topic-operation.go
|
||||
@@ -136,6 +138,7 @@ func (c *Component) Start() error {
|
||||
c.kafkaTopic, err)
|
||||
}
|
||||
l.Info().Msg("topic updated")
|
||||
client.ForceMetadataRefresh()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user