Skip to content

Commit

Permalink
Ignore blockstorage detach error when already detached
Browse files Browse the repository at this point in the history
  • Loading branch information
kobajagi committed Nov 11, 2024
1 parent 766b81d commit b76f9fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/resources/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,13 @@ func rUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag
bid,
)
if err != nil {
if !errors.Is(err, v3.ErrNotFound) {
// Ideally we would have a custom error defined in OpenAPI spec & egoscale.
// For now we just check the error text.
if strings.HasSuffix(err.Error(), "Volume not attached") {
tflog.Debug(ctx, "volume not attached")
} else {
return diag.Errorf("failed to detach block storage: %s", err)
}

continue
}

_, err = clientV3.Wait(ctx, op, v3.OperationStateSuccess)
Expand Down

0 comments on commit b76f9fe

Please sign in to comment.