Skip to content

fix(oracle): fix subnet selection logic #461

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

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

a-dubs
Copy link
Contributor

@a-dubs a-dubs commented Jan 29, 2025

When a subnet is not associated with an availability domain (AD),
we should not ignore the subnet just because it does not match our
configured AD. This change fixes the subnet selection logic to first
check if the subnet is associated with an AD before checking if it
matches the configured AD.

Before this change, the subnet selection logic was flawed and would
say it was using a certain subnet, but due to this bad AD logic, it
would actually not actually use the subnet it said it was using.

New unit test file was added that provides 100% coverage of the
get_subnet_id function!

@a-dubs a-dubs marked this pull request as draft January 29, 2025 22:58
@a-dubs a-dubs force-pushed the oracle-fix-subnet-selection branch 3 times, most recently from 621d5f2 to 554739b Compare January 30, 2025 16:12
@a-dubs a-dubs marked this pull request as ready for review January 30, 2025 16:12
@a-dubs a-dubs requested a review from TheRealFalcon January 30, 2025 16:13
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

One nit inline but otherwise LGTM! Nice test additions!

When a subnet is not associated with an availability domain (AD),
we should not ignore the subnet just because it does not match our
configured AD. This change fixes the subnet selection logic to first
check if the subnet is associated with an AD before checking if it
matches the configured AD.

Before this change, the subnet selection logic was flawed and would
say it was using a certain subnet, but due to this bad AD logic, it
would actually not actually use the subnet it said it was using.

New unit test file was added that provides 100% coverage of the
get_subnet_id function!
@a-dubs a-dubs force-pushed the oracle-fix-subnet-selection branch from 554739b to fb9ba41 Compare February 3, 2025 18:01
@a-dubs a-dubs merged commit 232fc39 into canonical:main Feb 3, 2025
4 of 5 checks passed
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.

3 participants