Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"sigs.k8s.io/external-dns/plan"
"sigs.k8s.io/external-dns/provider"
"sigs.k8s.io/external-dns/registry"
"sigs.k8s.io/external-dns/source"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -130,9 +131,9 @@ func newMockProvider(endpoints []*endpoint.Endpoint, changes *plan.Changes) prov
return dnsProvider
}

func getTestSource() *testutils.MockSource {
func getTestSource() *source.MockSource {
// Fake some desired endpoints coming from our source.
source := new(testutils.MockSource)
source := new(source.MockSource)
source.On("Endpoints").Return([]*endpoint.Endpoint{
{
DNSName: "create-record",
Expand Down Expand Up @@ -339,7 +340,7 @@ func testControllerFiltersDomains(t *testing.T, configuredEndpoints []*endpoint.
cfg := externaldns.NewConfig()
cfg.ManagedDNSRecordTypes = []string{endpoint.RecordTypeA, endpoint.RecordTypeAAAA, endpoint.RecordTypeCNAME}

source := new(testutils.MockSource)
source := new(source.MockSource)
source.On("Endpoints").Return(configuredEndpoints, nil)

// Fake some existing records in our DNS provider and validate some desired changes.
Expand Down
7 changes: 4 additions & 3 deletions controller/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"sigs.k8s.io/external-dns/pkg/apis/externaldns"
"sigs.k8s.io/external-dns/plan"
"sigs.k8s.io/external-dns/registry"
"sigs.k8s.io/external-dns/source"
)

func TestRecordKnownEndpointType(t *testing.T) {
Expand Down Expand Up @@ -322,7 +323,7 @@ func TestAAAARecords(t *testing.T) {
}

func TestGaugeMetricsWithMixedRecords(t *testing.T) {
configuredEndpoints := testutils.GenerateTestEndpointsByType(map[string]int{
configuredEndpoints := endpoint.GenerateTestEndpointsByType(map[string]int{
endpoint.RecordTypeA: 534,
endpoint.RecordTypeAAAA: 324,
endpoint.RecordTypeCNAME: 2,
Expand All @@ -331,7 +332,7 @@ func TestGaugeMetricsWithMixedRecords(t *testing.T) {
endpoint.RecordTypeNS: 3,
})

providerEndpoints := testutils.GenerateTestEndpointsByType(map[string]int{
providerEndpoints := endpoint.GenerateTestEndpointsByType(map[string]int{
endpoint.RecordTypeA: 5334,
endpoint.RecordTypeAAAA: 324,
endpoint.RecordTypeCNAME: 23,
Expand All @@ -344,7 +345,7 @@ func TestGaugeMetricsWithMixedRecords(t *testing.T) {
cfg := externaldns.NewConfig()
cfg.ManagedDNSRecordTypes = endpoint.KnownRecordTypes

source := new(testutils.MockSource)
source := new(source.MockSource)
source.On("Endpoints").Return(configuredEndpoints, nil)

provider := &filteredMockProvider{
Expand Down
Loading
Loading