Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use GlobalForwardingRules().Get() when detected a global fw rule #778

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we can just change all ForwardingRule to GlobalForwardingRule... but, anyway, let me try to fix test first...

I think this has the value, once we have L7 internal LB, forwarding rule might be regional.

} 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