Skip to content

Commit

Permalink
Add ListGlobalForwardingRules to the LoadBalancers interface.
Browse files Browse the repository at this point in the history
I have an upcoming commit in the k8s-multicluster-ingress repo where I will use this.
  • Loading branch information
G-Harmon committed Dec 5, 2017
1 parent 6dcd1bf commit 6bb9414
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/loadbalancers/fakes.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ func (f *FakeLoadBalancers) GetGlobalForwardingRule(name string) (*compute.Forwa
return nil, utils.FakeGoogleAPINotFoundErr()
}

func (f *FakeLoadBalancers) ListGlobalForwardingRules() (*compute.ForwardingRuleList, error) {
ruleList := &compute.ForwardingRuleList{}
ruleList.Items = f.Fw
return ruleList, nil
}

// CreateGlobalForwardingRule fakes forwarding rule creation.
func (f *FakeLoadBalancers) CreateGlobalForwardingRule(rule *compute.ForwardingRule) error {
f.calls = append(f.calls, "CreateGlobalForwardingRule")
Expand Down
1 change: 1 addition & 0 deletions pkg/loadbalancers/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type LoadBalancers interface {
CreateGlobalForwardingRule(rule *compute.ForwardingRule) error
DeleteGlobalForwardingRule(name string) error
SetProxyForGlobalForwardingRule(fw, proxy string) error
ListGlobalForwardingRules() (*compute.ForwardingRuleList, error)

// UrlMaps
GetUrlMap(name string) (*compute.UrlMap, error)
Expand Down

0 comments on commit 6bb9414

Please sign in to comment.