Skip to content

Commit

Permalink
Merge pull request #783 from kubernetes/revert-781-remove-lb-interface
Browse files Browse the repository at this point in the history
Revert "Remove Loadbalancer interface and use k8s-cloud-provider mocks"
  • Loading branch information
k8s-ci-robot authored Jun 24, 2019
2 parents 0269fea + 41a7e2d commit 3827fef
Show file tree
Hide file tree
Showing 12 changed files with 748 additions and 520 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
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/spencerhance/k8s-cloud-provider v0.0.0-20190622002134-a3b35430794f
github.com/GoogleCloudPlatform/k8s-cloud-provider => github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190612171043-2e19bb35a278
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
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ 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: 6 additions & 7 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ limitations under the License.
package controller

import (
"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud"
"strings"
"testing"
"time"

api_v1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -34,9 +37,6 @@ 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,8 +52,6 @@ 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 @@ -68,7 +66,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(fakeGCE, namer, events.RecorderProducerMock{})
lbc.l7Pool = loadbalancers.NewLoadBalancerPool(loadbalancers.NewFakeLoadBalancers(clusterUID, namer), namer, events.RecorderProducerMock{})
lbc.instancePool.Init(&instances.FakeZoneLister{Zones: []string{"zone-a"}})

lbc.hasSynced = func() bool { return true }
Expand Down Expand Up @@ -261,6 +259,7 @@ 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"

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

0 comments on commit 3827fef

Please sign in to comment.