Skip to content

Commit

Permalink
Implement support for ManagedCertificate CRD: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krzykwas committed Oct 26, 2018
1 parent b8eae9f commit 35be9b2
Show file tree
Hide file tree
Showing 8 changed files with 395 additions and 30 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/kubernetes/fake"
backendconfigclient "k8s.io/ingress-gce/pkg/backendconfig/client/clientset/versioned/fake"
"k8s.io/ingress-gce/pkg/events"
"k8s.io/ingress-gce/pkg/instances"
"k8s.io/ingress-gce/pkg/loadbalancers"
"k8s.io/ingress-gce/pkg/test"
Expand Down Expand Up @@ -60,11 +61,11 @@ func newLoadBalancerController() *LoadBalancerController {
HealthCheckPath: "/",
DefaultBackendHealthCheckPath: "/healthz",
}
ctx := context.NewControllerContext(kubeClient, backendConfigClient, fakeGCE, namer, ctxConfig)
ctx := context.NewControllerContext(kubeClient, backendConfigClient, nil, fakeGCE, namer, ctxConfig)
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)
lbc.l7Pool = loadbalancers.NewLoadBalancerPool(loadbalancers.NewFakeLoadBalancers(clusterUID, namer), namer, nil, events.RecorderProducerMock{})
lbc.instancePool.Init(&instances.FakeZoneLister{Zones: []string{"zone-a"}})

lbc.hasSynced = func() bool { return true }
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/translator/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func fakeTranslator(negEnabled, backendConfigEnabled bool) *Translator {
HealthCheckPath: "/",
DefaultBackendHealthCheckPath: "/healthz",
}
ctx := context.NewControllerContext(client, backendConfigClient, nil, namer, ctxConfig)
ctx := context.NewControllerContext(client, backendConfigClient, nil, nil, namer, ctxConfig)
gce := &Translator{
ctx: ctx,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/firewalls/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func newFirewallController() *FirewallController {
DefaultBackendSvcPortID: test.DefaultBeSvcPort.ID,
}

ctx := context.NewControllerContext(kubeClient, backendConfigClient, fakeGCE, namer, ctxConfig)
ctx := context.NewControllerContext(kubeClient, backendConfigClient, nil, fakeGCE, namer, ctxConfig)
fwc := NewFirewallController(ctx, []string{"30000-32767"})
fwc.hasSynced = func() bool { return true }

Expand Down
Loading

0 comments on commit 35be9b2

Please sign in to comment.