Skip to content

Commit

Permalink
Merge pull request #784 from spencerhance/redo-remove-lb-interface
Browse files Browse the repository at this point in the history
Redo "Remove Loadbalancer interface and use k8s-cloud-provider mocks"
  • Loading branch information
k8s-ci-robot committed Jun 25, 2019
2 parents 3827fef + 10ec2dc commit b5f633d
Show file tree
Hide file tree
Showing 12 changed files with 508 additions and 813 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module k8s.io/ingress-gce
go 1.12

require (
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190612171043-2e19bb35a278
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190625070306-c3ad81d637ad
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/beorn7/perks v1.0.0 // indirect
github.com/emicklei/go-restful v2.9.3+incompatible // indirect
Expand Down Expand Up @@ -45,7 +45,7 @@ require (

replace (
cloud.google.com/go => cloud.google.com/go v0.37.4
github.com/GoogleCloudPlatform/k8s-cloud-provider => github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190612171043-2e19bb35a278
github.com/GoogleCloudPlatform/k8s-cloud-provider => github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190625070306-c3ad81d637ad
github.com/PuerkitoBio/purell => github.com/PuerkitoBio/purell v1.1.1
github.com/beorn7/perks => github.com/beorn7/perks v1.0.0
github.com/emicklei/go-restful => github.com/emicklei/go-restful v2.9.3+incompatible
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190604211444-77eedaf6
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190604211444-77eedaf646f1/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190612171043-2e19bb35a278 h1:TgNrmegr5ot2LQQLFikl4VFrPvTvlOB2zCShOcpa+t8=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190612171043-2e19bb35a278/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190625070306-c3ad81d637ad h1:dmM8d/LQF+cpMG+hl73tMYjinBkSz+wdMxzQUlysfTI=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190625070306-c3ad81d637ad/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
Expand Down Expand Up @@ -158,6 +160,8 @@ github.com/prometheus/procfs v0.0.0-20190416084830-8368d24ba045/go.mod h1:TjEm7z
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spencerhance/k8s-cloud-provider v0.0.0-20190622002134-a3b35430794f h1:urtm5AHRaj52wI2J1zo8M7f5W8c7/LQqTKoPnJY2Q+k=
github.com/spencerhance/k8s-cloud-provider v0.0.0-20190622002134-a3b35430794f/go.mod h1:a2/swOxdL5eTqmC1yPqaY4Xvc0dsL6YBm5MolnXMq5g=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
13 changes: 7 additions & 6 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ limitations under the License.
package controller

import (
"strings"
"testing"
"time"

"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud"
api_v1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -37,6 +34,9 @@ import (
"k8s.io/ingress-gce/pkg/tls"
"k8s.io/ingress-gce/pkg/utils"
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"strings"
"testing"
"time"

"k8s.io/ingress-gce/pkg/context"
"k8s.io/ingress-gce/pkg/flags"
Expand All @@ -52,6 +52,8 @@ func newLoadBalancerController() *LoadBalancerController {
kubeClient := fake.NewSimpleClientset()
backendConfigClient := backendconfigclient.NewSimpleClientset()
fakeGCE := gce.NewFakeGCECloud(gce.DefaultTestClusterValues())

(fakeGCE.Compute().(*cloud.MockGCE)).MockGlobalForwardingRules.InsertHook = loadbalancers.InsertGlobalForwardingRuleHook
namer := utils.NewNamer(clusterUID, "")

stopCh := make(chan struct{})
Expand All @@ -66,7 +68,7 @@ func newLoadBalancerController() *LoadBalancerController {
lbc := NewLoadBalancerController(ctx, stopCh)
// TODO(rramkumar): Fix this so we don't have to override with our fake
lbc.instancePool = instances.NewNodePool(instances.NewFakeInstanceGroups(sets.NewString(), namer), namer)
lbc.l7Pool = loadbalancers.NewLoadBalancerPool(loadbalancers.NewFakeLoadBalancers(clusterUID, namer), namer, events.RecorderProducerMock{})
lbc.l7Pool = loadbalancers.NewLoadBalancerPool(fakeGCE, namer, events.RecorderProducerMock{})
lbc.instancePool.Init(&instances.FakeZoneLister{Zones: []string{"zone-a"}})

lbc.hasSynced = func() bool { return true }
Expand Down Expand Up @@ -259,7 +261,6 @@ func TestIngressCreateDeleteFinalizer(t *testing.T) {
if len(updatedIng.GetFinalizers()) != 1 {
t.Errorf("GetFinalizers() = %+v, want 0", updatedIng.GetFinalizers())
}

continue
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/loadbalancers/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"net/http"

compute "google.golang.org/api/compute/v1"
"google.golang.org/api/compute/v1"
"k8s.io/ingress-gce/pkg/utils"
"k8s.io/klog"
)
Expand Down
Loading

0 comments on commit b5f633d

Please sign in to comment.