1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

FEATURE: Add rTypes restrictions to IGNORE_NAME (#1808)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Dragos Harabor
2022-11-07 08:27:04 -08:00
committed by GitHub
parent 4b3d8f724e
commit 68516025a5
12 changed files with 121 additions and 39 deletions

View File

@@ -362,7 +362,7 @@ type TestGroup struct {
type TestCase struct {
Desc string
Records []*models.RecordConfig
IgnoredNames []string
IgnoredNames []*models.IgnoreName
IgnoredTargets []*models.IgnoreTarget
}
@@ -579,11 +579,11 @@ func testgroup(desc string, items ...interface{}) *TestGroup {
func tc(desc string, recs ...*models.RecordConfig) *TestCase {
var records []*models.RecordConfig
var ignoredNames []string
var ignoredNames []*models.IgnoreName
var ignoredTargets []*models.IgnoreTarget
for _, r := range recs {
if r.Type == "IGNORE_NAME" {
ignoredNames = append(ignoredNames, r.GetLabel())
ignoredNames = append(ignoredNames, &models.IgnoreName{Pattern: r.GetLabel(), Types: r.GetTargetField()})
} else if r.Type == "IGNORE_TARGET" {
rec := &models.IgnoreTarget{
Pattern: r.GetLabel(),