fix build

This commit is contained in:
Craig Peterson 2018-09-07 14:17:02 -04:00
parent d006f62f8f
commit e30cbff674
2 changed files with 9 additions and 9 deletions

View file

@ -8,20 +8,20 @@ func TestKey(t *testing.T) {
expected RecordKey
}{
{
RecordConfig{Type: "A", Name: "@"},
RecordKey{Type: "A", Name: "@"},
RecordConfig{Type: "A", NameFQDN: "example.com"},
RecordKey{Type: "A", NameFQDN: "example.com"},
},
{
RecordConfig{Type: "R53_ALIAS", Name: "@"},
RecordKey{Type: "R53_ALIAS", Name: "@"},
RecordConfig{Type: "R53_ALIAS", NameFQDN: "example.com"},
RecordKey{Type: "R53_ALIAS", NameFQDN: "example.com"},
},
{
RecordConfig{Type: "R53_ALIAS", Name: "@", R53Alias: map[string]string{"foo": "bar"}},
RecordKey{Type: "R53_ALIAS", Name: "@"},
RecordConfig{Type: "R53_ALIAS", NameFQDN: "example.com", R53Alias: map[string]string{"foo": "bar"}},
RecordKey{Type: "R53_ALIAS", NameFQDN: "example.com"},
},
{
RecordConfig{Type: "R53_ALIAS", Name: "@", R53Alias: map[string]string{"type": "AAAA"}},
RecordKey{Type: "R53_ALIAS_AAAA", Name: "@"},
RecordConfig{Type: "R53_ALIAS", NameFQDN: "example.com", R53Alias: map[string]string{"type": "AAAA"}},
RecordKey{Type: "R53_ALIAS_AAAA", NameFQDN: "example.com"},
},
}
for i, test := range tests {

View file

@ -15,7 +15,7 @@ func flattenSPFs(cfg *models.DNSConfig) []error {
var errs []error
var err error
for _, domain := range cfg.Domains {
apexTXTs := domain.Records.Grouped()[models.RecordKey{Type: "TXT", Name: "@"}]
apexTXTs := domain.Records.Grouped()[models.RecordKey{Type: "TXT", NameFQDN: domain.Name}]
// flatten all spf records that have the "flatten" metadata
for _, txt := range apexTXTs {
var rec *spflib.SPFRecord