Added empty eventhandler

This commit is contained in:
Johannes Grumböck 2020-04-01 06:43:53 +00:00
parent d476efb02c
commit 228be31b3e
2 changed files with 14 additions and 0 deletions

View File

@ -108,6 +108,9 @@ func NewOcpRouteSource(
}, nil
}
func (ors *ocpRouteSource) AddEventHandler(handler func() error, stopChan <-chan struct{}, minInterval time.Duration) {
}
// Endpoints returns endpoint objects for each host-target combination that should be processed.
// Retrieves all OpenShift Route resources on all namespaces
func (ors *ocpRouteSource) Endpoints() ([]*endpoint.Endpoint, error) {

View File

@ -22,6 +22,7 @@ import (
cfclient "github.com/cloudfoundry-community/go-cfclient"
contour "github.com/heptio/contour/apis/generated/clientset/versioned"
openshift "github.com/openshift/client-go/route/clientset/versioned"
fakeContour "github.com/heptio/contour/apis/generated/clientset/versioned/fake"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
@ -36,6 +37,7 @@ type MockClientGenerator struct {
istioClient istiomodel.ConfigStore
cloudFoundryClient *cfclient.Client
contourClient contour.Interface
openshiftClient openshift.Interface
}
func (m *MockClientGenerator) KubeClient() (kubernetes.Interface, error) {
@ -74,6 +76,15 @@ func (m *MockClientGenerator) ContourClient() (contour.Interface, error) {
return nil, args.Error(1)
}
func (m *MockClientGenerator) OpenShiftClient() (openshift.Interface, error) {
args := m.Called()
if args.Error(1) == nil {
m.openshiftClient = args.Get(0).(openshift.Interface)
return m.openshiftClient, nil
}
return nil, args.Error(1)
}
type ByNamesTestSuite struct {
suite.Suite
}