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

Fix TestAccMultiRegionServerlessClusterResource #155

Merged
merged 1 commit into from
Aug 8, 2023
Merged

Conversation

erademacher
Copy link
Contributor

Previously, the primary_region field used a UseStateForUnknown plan modifier, but that wasn't actually doing anything because we were checking the config instead of the plan. Now that we're checking the plan instead, the modifier is retaining the attribute's previous value when unknown (removed from the config). That was causing the previous primary region to still be marked as primary, and there was no validation to ensure that only one primary region is specified.

This change removes the plan modifier and adds validation to protect against multiple primaries.

Commit checklist

  • Changelog
  • Doc gen (make generate)
  • Integration test(s)
  • Acceptance test(s)
  • Example(s)

Previously, the primary_region field used a `UseStateForUnknown` plan
modifier, but that wasn't actually doing anything because we were
checking the config instead of the plan. Now that we're checking
the plan instead, the modifier is retaining the attribute's previous
value when unknown (removed from the config). That was causing the
previous primary region to still be marked as primary, and there was
no validation to ensure that only one primary region is specified.

This change removes the plan modifier and adds validation to protect
against multiple primaries.
Copy link
Contributor

@pjtatlow pjtatlow left a comment

Choose a reason for hiding this comment

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

LGTM!

@erademacher
Copy link
Contributor Author

TFTR!

@erademacher erademacher merged commit 6562186 into main Aug 8, 2023
3 checks passed
@erademacher erademacher deleted the fix-tests branch August 8, 2023 22:37
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