Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#2861 from anhdle-sso/redisclus…
Browse files Browse the repository at this point in the history
…ter_value_err

Fix redis cluster delete error due to not honoring AllowPartial flag
  • Loading branch information
google-oss-prow[bot] authored Oct 7, 2024
2 parents 57a7e1e + 3d6d7b7 commit a3581a7
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 a3581a7

Please sign in to comment.