Skip to content

Commit

Permalink
use GlobalForwardingRules().Get() when detected a global fw rule
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzacy committed Jun 18, 2019
1 parent 4ea4168 commit f868121
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/fuzz/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ func (g *GCLB) CheckResourceDeletion(ctx context.Context, c cloud.Cloud, options
var resources []meta.Key

for k := range g.ForwardingRule {
_, err := c.ForwardingRules().Get(ctx, &k)
var err error
if k.Region != "" {
_, err = c.ForwardingRules().Get(ctx, &k)
} else {
_, err = c.GlobalForwardingRules().Get(ctx, &k)
}
if err != nil {
if err.(*googleapi.Error) == nil || err.(*googleapi.Error).Code != http.StatusNotFound {
return fmt.Errorf("ForwardingRule %s is not deleted/error to get: %s", k.Name, err)
Expand Down

0 comments on commit f868121

Please sign in to comment.