Skip to content

Conversation

@averevki
Copy link
Contributor

Description

  • Adds a new test to verify that the DNS operator correctly handles conflicts when multiple DNSPolicies have defaultGeo set to True in a multicluster environment
  • Validates that both conflicting DNSPolicies enter the "AwaitingValidation" state instead of indicating becoming enforced

Closes #623

Tests

  • Added testsuite/tests/multicluster/load_balanced/test_default_geo_conflict.py with the test_default_geo_conflict test

Verification steps

Run the test:

poetry run pytest -vv testsuite/tests/multicluster/load_balanced/test_default_geo_conflict.py

# Note: This test requires a multicluster environment with DNS provider configuration.

@averevki averevki self-assigned this Dec 11, 2025
@averevki averevki added the DNS Issues for DNSOperator label Dec 11, 2025
@averevki averevki moved this to Ready For Review in Kuadrant Dec 11, 2025

def test_default_geo_conflict(dns_policy, dns_policy2):
"""Verify that when two DNSPolicies have defaultGeo=True, both policies enter the await validation state"""
sleep(60) # wait a bit for records between two clusters to synchronize
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we replace the hardcoded sleep with something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know it's not the best solution, I just needed to wait for an arbitrary reconciliation time for dns-operator dns records to synchronize between clusters. I'd expect this time to be longer when you have more clusters and dns policies in the dns-operator pool. Feel free to suggest if you have different solution on your mind. I'd implement testsuite-wide solution if we can come up with anything better


assert dns_policy.wait_until(
has_record_condition("Ready", "False", "AwaitingValidation", "Awaiting validation"), timelimit=450
), f"DNSPolicy did not reach expected record status, instead it was: {dns_policy2.model.status.recordConditions}"
Copy link
Contributor

Choose a reason for hiding this comment

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

this assertion is checking dns_policy so you should not use dns_policy2 in the error message

for component in [gateway, gateway2, tls_policy, tls_policy2]:
component.wait_for_ready()
for component in [dns_policy, dns_policy2]:
component.wait_for_accepted()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would personally add dns_policy2 later inside test_... function so here it would be ok to wait_for_ready for dns_policy1. To me adding dns_policy2 to create a conflict is part of test scenario rather that the test setup.
For sure this does not block the merging

sleep(60) # wait a bit for records between two clusters to synchronize

assert dns_policy.wait_until(
has_record_condition("Ready", "False", "AwaitingValidation", "Awaiting validation"), timelimit=450
Copy link
Contributor

Choose a reason for hiding this comment

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

The 450s time limit is quite long, is it really needed to be that long?

Signed-off-by: averevki <sandyverevkin@gmail.com>
@averevki averevki force-pushed the dns-geo-conflict-test branch from 18d1da8 to 945af03 Compare January 23, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DNS Issues for DNSOperator

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

Default GEO conflict and resolution test (2 policies with different GEO)

3 participants