mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
AZUREDNS: Do not warn about underscore for acm-validations.aws (#661)
* Check for acm-validations.aws.
This commit is contained in:
@ -100,7 +100,7 @@ var labelUnderscores = []string{
|
||||
// these record types may contain underscores
|
||||
var rTypeUnderscores = []string{"SRV", "TLSA", "TXT"}
|
||||
|
||||
func checkLabel(label string, rType string, domain string, meta map[string]string) error {
|
||||
func checkLabel(label string, rType string, target, domain string, meta map[string]string) error {
|
||||
if label == "@" {
|
||||
return nil
|
||||
}
|
||||
@ -125,6 +125,11 @@ func checkLabel(label string, rType string, domain string, meta map[string]strin
|
||||
return nil
|
||||
}
|
||||
}
|
||||
// Don't warn for CNAMEs if the target ends with acm-validations.aws
|
||||
// See https://github.com/StackExchange/dnscontrol/issues/519
|
||||
if strings.HasPrefix(label, "_") && rType == "CNAME" && strings.HasSuffix(target, ".acm-validations.aws.") {
|
||||
return nil
|
||||
}
|
||||
// Don't warn for certain label substrings
|
||||
for _, ex := range labelUnderscores {
|
||||
if strings.Contains(label, ex) {
|
||||
@ -296,7 +301,7 @@ func NormalizeAndValidateConfig(config *models.DNSConfig) (errs []error) {
|
||||
if err := validateRecordTypes(rec, domain.Name, pTypes); err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
if err := checkLabel(rec.GetLabel(), rec.Type, domain.Name, rec.Metadata); err != nil {
|
||||
if err := checkLabel(rec.GetLabel(), rec.Type, rec.GetTargetField(), domain.Name, rec.Metadata); err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
if errs2 := checkTargets(rec, domain.Name); errs2 != nil {
|
||||
|
Reference in New Issue
Block a user