Skip to content

Commit

Permalink
fix: incompatible ServiceSchemaRegistryCompatibility updated response
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov committed Nov 1, 2024
1 parent bbebde0 commit a7ee448
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/sdkprovider/service/kafkaschema/kafka_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"reflect"
"regexp"
"strings"
"time"

"github.com/aiven/aiven-go-client/v2"
Expand Down Expand Up @@ -301,7 +302,7 @@ func resourceKafkaSchemaCustomizeDiff(ctx context.Context, d *schema.ResourceDif
return nil
}

compatible, err := client.ServiceSchemaRegistryCompatibility(
r, err := client.ServiceSchemaRegistryCompatibility(
ctx,
d.Get("project").(string),
d.Get("service_name").(string),
Expand All @@ -317,8 +318,8 @@ func resourceKafkaSchemaCustomizeDiff(ctx context.Context, d *schema.ResourceDif
return fmt.Errorf("unable to check schema validity: %w", err)
}

if !compatible {
return fmt.Errorf("schema is not compatible with previous version")
if !r.IsCompatible {
return fmt.Errorf("schema is not compatible with previous version: %s", strings.Join(r.Messages, ", "))
}

return nil
Expand Down

0 comments on commit a7ee448

Please sign in to comment.