mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-07 10:06:57 +02:00
Update references to UKFast to ANS group
Signed-off-by: Rick Henry <rick.henry@assureddigitaltech.com>
This commit is contained in:
parent
e58a901d5c
commit
aab63ec4f7
@ -21,10 +21,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
ansClient "github.com/ans-group/sdk-go/pkg/client"
|
||||||
ukfClient "github.com/ans-group/sdk-go/pkg/client"
|
ansConnection "github.com/ans-group/sdk-go/pkg/connection"
|
||||||
ukfConnection "github.com/ans-group/sdk-go/pkg/connection"
|
|
||||||
"github.com/ans-group/sdk-go/pkg/service/safedns"
|
"github.com/ans-group/sdk-go/pkg/service/safedns"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"sigs.k8s.io/external-dns/endpoint"
|
"sigs.k8s.io/external-dns/endpoint"
|
||||||
"sigs.k8s.io/external-dns/plan"
|
"sigs.k8s.io/external-dns/plan"
|
||||||
@ -38,8 +38,8 @@ type SafeDNS interface {
|
|||||||
DeleteZoneRecord(zoneName string, recordID int) error
|
DeleteZoneRecord(zoneName string, recordID int) error
|
||||||
GetZone(zoneName string) (safedns.Zone, error)
|
GetZone(zoneName string) (safedns.Zone, error)
|
||||||
GetZoneRecord(zoneName string, recordID int) (safedns.Record, error)
|
GetZoneRecord(zoneName string, recordID int) (safedns.Record, error)
|
||||||
GetZoneRecords(zoneName string, parameters ukfConnection.APIRequestParameters) ([]safedns.Record, error)
|
GetZoneRecords(zoneName string, parameters ansConnection.APIRequestParameters) ([]safedns.Record, error)
|
||||||
GetZones(parameters ukfConnection.APIRequestParameters) ([]safedns.Zone, error)
|
GetZones(parameters ansConnection.APIRequestParameters) ([]safedns.Zone, error)
|
||||||
PatchZoneRecord(zoneName string, recordID int, patch safedns.PatchRecordRequest) (int, error)
|
PatchZoneRecord(zoneName string, recordID int, patch safedns.PatchRecordRequest) (int, error)
|
||||||
UpdateZoneRecord(zoneName string, record safedns.Record) (int, error)
|
UpdateZoneRecord(zoneName string, record safedns.Record) (int, error)
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ type SafeDNSProvider struct {
|
|||||||
// Only consider hosted zones managing domains ending in this suffix
|
// Only consider hosted zones managing domains ending in this suffix
|
||||||
domainFilter endpoint.DomainFilter
|
domainFilter endpoint.DomainFilter
|
||||||
DryRun bool
|
DryRun bool
|
||||||
APIRequestParams ukfConnection.APIRequestParameters
|
APIRequestParams ansConnection.APIRequestParameters
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneRecord is a datatype to simplify management of a record in a zone.
|
// ZoneRecord is a datatype to simplify management of a record in a zone.
|
||||||
@ -70,15 +70,15 @@ func NewSafeDNSProvider(domainFilter endpoint.DomainFilter, dryRun bool) (*SafeD
|
|||||||
return nil, fmt.Errorf("no SAFEDNS_TOKEN found in environment")
|
return nil, fmt.Errorf("no SAFEDNS_TOKEN found in environment")
|
||||||
}
|
}
|
||||||
|
|
||||||
ukfAPIConnection := ukfConnection.NewAPIKeyCredentialsAPIConnection(token)
|
ukfAPIConnection := ansConnection.NewAPIKeyCredentialsAPIConnection(token)
|
||||||
ukfClient := ukfClient.NewClient(ukfAPIConnection)
|
ansClient := ansClient.NewClient(ukfAPIConnection)
|
||||||
safeDNS := ukfClient.SafeDNSService()
|
safeDNS := ansClient.SafeDNSService()
|
||||||
|
|
||||||
provider := &SafeDNSProvider{
|
provider := &SafeDNSProvider{
|
||||||
Client: safeDNS,
|
Client: safeDNS,
|
||||||
domainFilter: domainFilter,
|
domainFilter: domainFilter,
|
||||||
DryRun: dryRun,
|
DryRun: dryRun,
|
||||||
APIRequestParams: *ukfConnection.NewAPIRequestParameters(),
|
APIRequestParams: *ansConnection.NewAPIRequestParameters(),
|
||||||
}
|
}
|
||||||
return provider, nil
|
return provider, nil
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,11 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
ansConnection "github.com/ans-group/sdk-go/pkg/connection"
|
||||||
|
"github.com/ans-group/sdk-go/pkg/service/safedns"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/mock"
|
"github.com/stretchr/testify/mock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
ukfConnection "github.com/ans-group/sdk-go/pkg/connection"
|
|
||||||
"github.com/ans-group/sdk-go/pkg/service/safedns"
|
|
||||||
|
|
||||||
"sigs.k8s.io/external-dns/endpoint"
|
"sigs.k8s.io/external-dns/endpoint"
|
||||||
"sigs.k8s.io/external-dns/plan"
|
"sigs.k8s.io/external-dns/plan"
|
||||||
@ -56,12 +56,12 @@ func (m *MockSafeDNSService) GetZoneRecord(zoneName string, recordID int) (safed
|
|||||||
return args.Get(0).(safedns.Record), args.Error(1)
|
return args.Get(0).(safedns.Record), args.Error(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockSafeDNSService) GetZoneRecords(zoneName string, parameters ukfConnection.APIRequestParameters) ([]safedns.Record, error) {
|
func (m *MockSafeDNSService) GetZoneRecords(zoneName string, parameters ansConnection.APIRequestParameters) ([]safedns.Record, error) {
|
||||||
args := m.Called(zoneName, parameters)
|
args := m.Called(zoneName, parameters)
|
||||||
return args.Get(0).([]safedns.Record), args.Error(1)
|
return args.Get(0).([]safedns.Record), args.Error(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockSafeDNSService) GetZones(parameters ukfConnection.APIRequestParameters) ([]safedns.Zone, error) {
|
func (m *MockSafeDNSService) GetZones(parameters ansConnection.APIRequestParameters) ([]safedns.Zone, error) {
|
||||||
args := m.Called(parameters)
|
args := m.Called(parameters)
|
||||||
return args.Get(0).([]safedns.Zone), args.Error(1)
|
return args.Get(0).([]safedns.Zone), args.Error(1)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user