Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Event Streams: do not return error when topic exists in creation #3223

Merged
merged 1 commit into from Dec 6, 2021
Merged

Conversation

JunliWang
Copy link
Contributor

@JunliWang JunliWang commented Oct 18, 2021

when terraform state is out of sync with topic state, error could happen when re-apply the configuration.

#2275

@hkantare
Copy link
Collaborator

Can you please update testcase results

@@ -123,7 +134,20 @@ func resourceIBMEventStreamsTopicCreate(d *schema.ResourceData, meta interface{}
}
err = adminClient.CreateTopic(topicName, &topicDetail, false)
if err != nil {
log.Printf("[DEBUG] resourceIBMEventStreamsTopicCreate CreateTopic err %s", err)
if kafkaErr, ok := err.(*sarama.TopicError); ok {
if kafkaErr.Err == sarama.ErrTopicAlreadyExists {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add if kafkaErr != nil && kafkaErr.Err == sarama.ErrTopicAlreadyExists (to eliminate crash )

@hkantare
Copy link
Collaborator

hkantare commented Nov 3, 2021

@JunliWang any update on PR

@sflaherty2009
Copy link

@JunliWang Do we have any update on this?

@sflaherty2009
Copy link

@JunliWang @hkantare Do we have any update on this. This is something that breaks at random when building our cluster through terraform and creates a lot of manual work in order to correct.

@hkantare hkantare merged commit 2e095a8 into IBM-Cloud:master Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants