Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
torgiren
External Dns
Commits
904d8e4c
Commit
904d8e4c
authored
4 years ago
by
Yury Tsarev
Browse files
Options
Download
Email Patches
Plain Diff
NS record support
parent
45471b73
master
Raffo-patch-1
correctly-update-aws-records-when-type-changes
dependabot/go_modules/github.com/Azure/azure-sdk-for-go-61.4.0incompatible
dependabot/go_modules/github.com/aliyun/alibaba-cloud-sdk-go-1.61.1473
dependabot/go_modules/github.com/exoscale/egoscale-1.19.0
dependabot/go_modules/github.com/projectcontour/contour-1.20.0
dependabot/go_modules/k8s.io/apimachinery-0.23.3
gh-pages
normalize
raffo-fix-2348
raffo/add-dependabot
raffo/add-trivy-scanning
raffo/arm32v7
raffo/bump-ci-timeout
raffo/bump-deps-sec
raffo/bump-kustomize
raffo/bump-kustomize-1
raffo/bump-kustomize-version-0.7.5
raffo/bump-modules
raffo/codeQL
raffo/drop-the-changelog
raffo/fix-1820
raffo/fix-1936
raffo/fix-build
raffo/fix-dependabot
raffo/fix-ns-deletion
raffo/fix-scaleway-security
raffo/fix-that-typo
raffo/fix-trivy
raffo/fix-trivy-again
raffo/fix-vulnerabilities
raffo/goarm
raffo/knolog
raffo/multiarch-docs
raffo/new-ingress-resource
raffo/release-conventions
raffo/release-note-patch
raffo/release-script-update
raffo/remove-azure-test
raffo/remove-broken-link
raffo/revert-tzdata
raffo/update-kustomize-080
raffo/update-v0.10-role
raffo/v0.7.6
v1.0.0-mf
v0.10.2
v0.10.1
v0.10.0
v0.9.0
v0.8.0
v0.7.6
v0.7.5
external-dns-helm-chart-1.7.1
external-dns-helm-chart-1.7.0
external-dns-helm-chart-1.6.0
external-dns-helm-chart-1.5.0
external-dns-helm-chart-1.4.1
external-dns-helm-chart-1.4.0
external-dns-helm-chart-1.3.2
external-dns-helm-chart-1.3.1
external-dns-helm-chart-1.3.0
external-dns-helm-chart-1.2.0
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
.gitignore
+2
-0
.gitignore
endpoint/endpoint.go
+2
-0
endpoint/endpoint.go
go.sum
+2
-0
go.sum
plan/plan.go
+1
-1
plan/plan.go
provider/recordfilter.go
+2
-2
provider/recordfilter.go
source/crd_test.go
+20
-0
source/crd_test.go
with
29 additions
and
3 deletions
+29
-3
.gitignore
+
2
-
0
View file @
904d8e4c
...
...
@@ -46,3 +46,5 @@ external-dns
# vendor dir
vendor/
profile.cov
This diff is collapsed.
Click to expand it.
endpoint/endpoint.go
+
2
-
0
View file @
904d8e4c
...
...
@@ -33,6 +33,8 @@ const (
RecordTypeTXT
=
"TXT"
// RecordTypeSRV is a RecordType enum value
RecordTypeSRV
=
"SRV"
// RecordTypeNS is a RecordType enum value
RecordTypeNS
=
"NS"
)
// TTL is a structure defining the TTL of a DNS record
...
...
This diff is collapsed.
Click to expand it.
go.sum
+
2
-
0
View file @
904d8e4c
...
...
@@ -15,6 +15,8 @@ code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f/go.mod h1:s
dmitri.shuralyov.com/gpu/mtl
v0.0.0-20190408044501-666a987793e9/go.mod h1:
H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.blindage.org/21h/hcloud-dns
v0.0.0-20200525170043-def10a4a28e0 h1:
kdxglEveTcqIG5zEPdQ0Y5KctnIGR7zXsQCQakoTNxU=
git.blindage.org/21h/hcloud-dns
v0.0.0-20200525170043-def10a4a28e0/go.mod h1:
n26Twiii5jhkMC+Ocz/s8R73cBBcXRIwyTqQ+6bOZGo=
git.blindage.org/21h/hcloud-dns
v0.0.0-20200807003420-f768ffe03f8d h1:
d6sdozgfqtgaOhjUn++lbo5siX3HELjcOUnbtrvVQi4=
git.blindage.org/21h/hcloud-dns
v0.0.0-20200807003420-f768ffe03f8d/go.mod h1:
n26Twiii5jhkMC+Ocz/s8R73cBBcXRIwyTqQ+6bOZGo=
github.com/Azure/azure-sdk-for-go
v45.1.0+incompatible h1:
kxtaPD8n2z5Za+9e3sKsYG2IX6PG2R6VXtgS7gAbh3A=
github.com/Azure/azure-sdk-for-go
v45.1.0+incompatible/go.mod h1:
9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-ansiterm
v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:
LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
...
...
This diff is collapsed.
Click to expand it.
plan/plan.go
+
1
-
1
View file @
904d8e4c
...
...
@@ -242,7 +242,7 @@ func filterRecordsForPlan(records []*endpoint.Endpoint, domainFilter endpoint.Do
// Explicitly specify which records we want to use for planning.
// TODO: Add AAAA records as well when they are supported.
switch
record
.
RecordType
{
case
endpoint
.
RecordTypeA
,
endpoint
.
RecordTypeCNAME
:
case
endpoint
.
RecordTypeA
,
endpoint
.
RecordTypeCNAME
,
endpoint
.
RecordTypeNS
:
filtered
=
append
(
filtered
,
record
)
default
:
continue
...
...
This diff is collapsed.
Click to expand it.
provider/recordfilter.go
+
2
-
2
View file @
904d8e4c
...
...
@@ -17,10 +17,10 @@ limitations under the License.
package
provider
// SupportedRecordType returns true only for supported record types.
// Currently A, CNAME, SRV, and
TXT
record types are supported.
// Currently A, CNAME, SRV,
TXT
and
NS
record types are supported.
func
SupportedRecordType
(
recordType
string
)
bool
{
switch
recordType
{
case
"A"
,
"CNAME"
,
"SRV"
,
"TXT"
:
case
"A"
,
"CNAME"
,
"SRV"
,
"TXT"
,
"NS"
:
return
true
default
:
return
false
...
...
This diff is collapsed.
Click to expand it.
source/crd_test.go
+
20
-
0
View file @
904d8e4c
...
...
@@ -351,6 +351,26 @@ func testCRDSourceEndpoints(t *testing.T) {
expectEndpoints
:
true
,
expectError
:
false
,
},
{
title
:
"Create NS record"
,
registeredAPIVersion
:
"test.k8s.io/v1alpha1"
,
apiVersion
:
"test.k8s.io/v1alpha1"
,
registeredKind
:
"DNSEndpoint"
,
kind
:
"DNSEndpoint"
,
namespace
:
"foo"
,
registeredNamespace
:
"foo"
,
labels
:
map
[
string
]
string
{
"test"
:
"that"
},
labelFilter
:
"test=that"
,
endpoints
:
[]
*
endpoint
.
Endpoint
{
{
DNSName
:
"abc.example.org"
,
Targets
:
endpoint
.
Targets
{
"ns1.k8s.io"
,
"ns2.k8s.io"
},
RecordType
:
endpoint
.
RecordTypeNS
,
RecordTTL
:
180
,
},
},
expectEndpoints
:
true
,
expectError
:
false
,
},
}
{
t
.
Run
(
ti
.
title
,
func
(
t
*
testing
.
T
)
{
restClient
:=
startCRDServerToServeTargets
(
ti
.
endpoints
,
ti
.
registeredAPIVersion
,
ti
.
registeredKind
,
ti
.
registeredNamespace
,
"test"
,
ti
.
annotations
,
ti
.
labels
,
t
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help