mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-16 21:58:50 +08:00
<!--
## Before submiting a pull request
Please make sure you've run the following commands from the root
directory.
bin/generate-all.sh
(this runs commands like "go generate", fixes formatting, and so on)
## Release changelog section
Help keep the release changelog clear by pre-naming the proper section
in the GitHub pull request title.
Some examples:
* CICD: Add required GHA permissions for goreleaser
* DOCS: Fixed providers with "contributor support" table
* ROUTE53: Allow R53_ALIAS records to enable target health evaluation
More examples/context can be found in the file .goreleaser.yml under the
'build' > 'changelog' key.
!-->
The PR fixes #3850.
This commit is contained in:
parent
539fe5ce3e
commit
b992ae32ef
2 changed files with 14 additions and 1 deletions
|
|
@ -819,6 +819,15 @@ func stringDefault(value interface{}, def string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *cloudflareProvider) nativeToRecord(domain string, cr cloudflare.DNSRecord) (*models.RecordConfig, error) {
|
func (c *cloudflareProvider) nativeToRecord(domain string, cr cloudflare.DNSRecord) (*models.RecordConfig, error) {
|
||||||
|
// Check for read_only metadata
|
||||||
|
// https://github.com/StackExchange/dnscontrol/issues/3850
|
||||||
|
if cr.Meta != nil {
|
||||||
|
if metaMap, ok := cr.Meta.(map[string]interface{}); ok {
|
||||||
|
if readOnly, ok := metaMap["read_only"].(bool); ok && readOnly {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ALIAS in Cloudflare works like CNAME.
|
// ALIAS in Cloudflare works like CNAME.
|
||||||
if cr.Type == "ALIAS" {
|
if cr.Type == "ALIAS" {
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,12 @@ func (c *cloudflareProvider) getRecordsForDomain(id string, domain string) ([]*m
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// nativeToRecord may return nil if the record is supposed to be skipped
|
||||||
|
// i.e. read only, cloudflare-managed, etc.
|
||||||
|
if rt != nil {
|
||||||
records = append(records, rt)
|
records = append(records, rt)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return records, nil
|
return records, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue