octodns / octodns-cloudflare

Cloudflare DNS provider for octoDNS
MIT License
24 stars 18 forks source link

PR suggestion - add ignore_proxied setting to avoid overwriting CF setting #13

Closed mrbarletta closed 2 years ago

mrbarletta commented 2 years ago

In my scenario, the source does not support the proxied setting, so when syncing to a CF target it always sets the proxied boolean as false.

If we manually set the proxied setting on the CF website for some specific records then octodns-sync will set them to false again.

We did a little change to include an ignore_proxied setting so if set to true, the proxied setting will not be included in the sync.

Are you open to include this if I do a PR? these are the changes so far:

__init__py:50

def __init__(self, id, email=None, token=None, cdn=False, retry_count=4,
                 retry_period=300, zones_per_page=50, records_per_page=100,ignore_proxied=False,
                 *args, **kwargs):

__init__py:71

self.ignore_proxied = ignore_proxied

__init__py:316

if _type in _PROXIABLE_RECORD_TYPES:
            if not self.ignore_proxied:
                if( records[0].get('proxied', False)):
                    record._octodns['cloudflare'] = {
                        'proxied': records[0].get('proxied', False)
                    }
ross commented 2 years ago

Fwiw I'd recommend opening questions like this as a PR as it's probably easier than manually including the changes in the body above. It's find to open it as a Draft PR if the tests aren't passing/written yet.

As for the change itself, it may make sense, but I or someone more familiar with the CF provider would need to dig into it a bit deeper.

mrbarletta commented 2 years ago

Thanks @ross, PR opened #14

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

mrbarletta commented 2 years ago

14 updated to keep this issue alive

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.