Skip to content

Commit

Permalink
Fix redis cluster delete error due to not honoring AllowPartial flag
Browse files Browse the repository at this point in the history
  • Loading branch information
anhdle-sso committed Oct 4, 2024
1 parent c0a7791 commit 3d6d7b7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"reflect"
"strings"

api "cloud.google.com/go/redis/cluster/apiv1"
pb "cloud.google.com/go/redis/cluster/apiv1/clusterpb"
Expand Down Expand Up @@ -187,11 +188,15 @@ func (a *redisClusterAdapter) Delete(ctx context.Context, deleteOp *directbase.D
if direct.IsNotFound(err) {
return false, nil
}
return false, fmt.Errorf("deleting redisCluster %s: %w", a.fullyQualifiedName(), err)
if !strings.Contains(err.Error(), "missing \"value\" field") {
return false, fmt.Errorf("deleting redisCluster %s: %w", a.fullyQualifiedName(), err)
}
}

if err := op.Wait(ctx); err != nil {
return false, fmt.Errorf("waiting for redisCluster delete %s: %w", a.fullyQualifiedName(), err)
if !strings.Contains(err.Error(), "missing \"value\" field") {
return false, fmt.Errorf("waiting for redisCluster delete %s: %w", a.fullyQualifiedName(), err)
}
}

return true, nil
Expand Down

0 comments on commit 3d6d7b7

Please sign in to comment.