Skip to content

Commit

Permalink
feat(kafkatopic): creation simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-savciuc committed Sep 14, 2023
1 parent 25b4de4 commit 2bc6bf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 78 deletions.
20 changes: 7 additions & 13 deletions internal/sdkprovider/service/kafkatopic/kafka_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,13 @@ func resourceKafkaTopicCreate(ctx context.Context, d *schema.ResourceData, m int
Tags: getTags(d),
}

w := &kafkaTopicCreateWaiter{
Client: m.(*aiven.Client),
Project: project,
ServiceName: serviceName,
CreateRequest: createRequest,
}

timeout := d.Timeout(schema.TimeoutCreate)

// nolint:staticcheck // TODO: Migrate to helper/retry package to avoid deprecated WaitForStateContext.
_, err = w.Conf(timeout).WaitForStateContext(ctx)
if err != nil {
return diag.FromErr(err)
err = m.(*aiven.Client).KafkaTopics.Create(
project,
serviceName,
createRequest,
)
if err != nil && !aiven.IsAlreadyExists(err) {
diag.FromErr(err)
}

d.SetId(schemautil.BuildResourceID(project, serviceName, topicName))
Expand Down
65 changes: 0 additions & 65 deletions internal/sdkprovider/service/kafkatopic/kafka_topic_create.go

This file was deleted.

0 comments on commit 2bc6bf4

Please sign in to comment.