Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option 'exclude_disabled' to filter disabled records #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

otlich
Copy link

@otlich otlich commented Feb 27, 2024

Firstly, sorting has been added for defaults. This solves the problem when two different plugins with support weighted records choose different value for the weighted CNAME record.

Second. I added an option exclude_disabled to filter rrset that have ebabled: false

Added defaults sorting for predictable value for weighted CNAME records
Copy link
Contributor

@ross ross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline. At a high level this seems to be changing multiple things in one PR. The version bit shouldn't happen here. The defaults change seems unrelated to exclude_disabled and thus should happen in its own PR along with related tests.

This PR can be pared back \to just do the exclude_disabled bits.

@@ -15,7 +15,7 @@
from octodns.record import GeoCodes, Record

# TODO: remove __VERSION__ with the next major version release
__version__ = __VERSION__ = '0.0.2'
__version__ = __VERSION__ = '0.0.3'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version bumps happen in dedicated release PRs.

@@ -219,6 +220,7 @@ def _build_pools(self, record, default_pool_name, value_transform_fn):

pools[geo_sets[geo_set]]["values"].append(value)

defaults.sort()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to include a comment on this change as to why it's needed/what it fixes.

_result_resource_record = []
for resource_record in record["resource_records"]:
if resource_record.get("enabled", True):
_result_resource_record.append(resource_record)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if all the rr's are eanbled=False? Looks like record["resource_records"] would be []. Is that valid?

@@ -39,7 +39,7 @@
- pool: weight
ttl: 300
type: CNAME
value: cl-dabdb3fc.edgecdn.ru.
value: cl-dabdb1fc.edgecdn.ru.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this change for? I don't see any corresponding changes in the tests below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants