KFS-362 Fix deleteTopics usage in confluent ksql cluster delete cmd#1536
KFS-362 Fix deleteTopics usage in confluent ksql cluster delete cmd#1536Martin Tang (MarTango) merged 1 commit intomainfrom
confluent ksql cluster delete cmd#1536Conversation
Fixes two issues:
- We were calling `c.deleteTopics(req)`, but `req.Endpoint` is `nil`.
- We had
```go
if !provisioningFailed && err != nil {
}
```
which is always false.
| client := sling.New().Client(oauth2.NewClient(context.Background(), ts)).Base(endpoint) | ||
| request := map[string][]string{"deleteTopicList": {".*"}} | ||
| response, err := client.Post("/ksql/terminate").BodyJSON(&request).ReceiveSuccess(nil) |
There was a problem hiding this comment.
Remind me why we're not using an SDK (such as ccloud-sdk-go-v2) here?
There was a problem hiding this comment.
KSQL itself doesn't have an official (go) SDK (I'm not sure why - probably because the API isn't stable yet), which is why we use a generic rest-client.. maybe?
There does seem to be an unofficial go client, but integrating it here is outside the scope of this bugfix.
There was a problem hiding this comment.
Ah, right. I think we talked about this in the past, and you or someone else on your team opened a ticket to make a ksql-rest-sdk-go repo, similar to https://github.com/confluentinc/kafka-rest-sdk-go. It would be great if that could be prioritized since the current method is difficult to test and impossible to debug.
Fixes two issues:
c.deleteTopics(req), butreq.Endpointisnil.go if !provisioningFailed && err != nil { }which is always false.Checklist
What
These fixes were already applied to the v3 branch. Pulling them into main in this PR
References
#1371