Skip to content

Commit

Permalink
update terraform as per latest eventstreams go sdk release 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sreee9 committed Oct 18, 2023
1 parent 68553f7 commit 6e96804
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/IBM/container-registry-go-sdk v1.1.0
github.com/IBM/continuous-delivery-go-sdk v1.2.0
github.com/IBM/event-notifications-go-admin-sdk v0.2.4
github.com/IBM/eventstreams-go-sdk v1.2.0
github.com/IBM/eventstreams-go-sdk v1.4.0
github.com/IBM/go-sdk-core/v3 v3.2.4
github.com/IBM/go-sdk-core/v5 v5.14.1
github.com/IBM/ibm-cos-sdk-go v1.10.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ github.com/IBM/event-notifications-go-admin-sdk v0.2.4 h1:WWUxwrKQxvExEK+xaAQOs6
github.com/IBM/event-notifications-go-admin-sdk v0.2.4/go.mod h1:1TlGAFP47DybbovJfHtYYgSI8xpLL8Q0wao6vsAlb6c=
github.com/IBM/eventstreams-go-sdk v1.2.0 h1:eP0afHArMGjwhGqvZAhhu/3EDKRch2JehpveqF1TUjs=
github.com/IBM/eventstreams-go-sdk v1.2.0/go.mod h1:2tuAxaYLctfqfr5jvyqSrxxEQGMwYPm3yJGWSj85YVQ=
github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM=
github.com/IBM/eventstreams-go-sdk v1.4.0/go.mod h1:2tuAxaYLctfqfr5jvyqSrxxEQGMwYPm3yJGWSj85YVQ=
github.com/IBM/go-sdk-core/v3 v3.0.0/go.mod h1:JI5NS2+iCoY/D8Oq3JNEZNA7qO42agu6fnaUmDsRcJA=
github.com/IBM/go-sdk-core/v3 v3.2.4 h1:WKYJYYKlZnw1y/gM+Qbf5EQVAL9xaoD54+ooJZz/iBQ=
github.com/IBM/go-sdk-core/v3 v3.2.4/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QCCKDRsUA2M0=
Expand Down
12 changes: 11 additions & 1 deletion ibm/service/eventstreams/resource_ibm_event_streams_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,17 @@ func resourceIBMEventStreamsSchemaDelete(context context.Context, d *schema.Reso
schemaID := d.Get("schema_id").(string)
deleteSchemaOptions.SetID(schemaID)

response, err := schemaregistryClient.DeleteSchemaWithContext(context, deleteSchemaOptions)
setSchemaOptions := &schemaregistryv1.SetSchemaStateOptions{}
setSchemaOptions.SetID(schemaID)
setSchemaOptions.SetState("DISABLED")

// set schema state to disabled before deleting
response, err := schemaregistryClient.SetSchemaStateWithContext(context, setSchemaOptions)
if err != nil {
log.Printf("[DEBUG] SetSchemaStateWithContext failed %s\n%s", err, response)
}

response, err = schemaregistryClient.DeleteSchemaWithContext(context, deleteSchemaOptions)
if err != nil {
log.Printf("[DEBUG] DeleteSchemaWithContext failed %s\n%s", err, response)
return diag.FromErr(fmt.Errorf("DeleteSchemaWithContext failed %s\n%s", err, response))
Expand Down

0 comments on commit 6e96804

Please sign in to comment.