-
Notifications
You must be signed in to change notification settings - Fork 669
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
ICD: Promote read replicas #5738
Conversation
location = "%[3]s" | ||
service_endpoints = "public-and-private" | ||
remote_leader_id = "%[4]s" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than duplicating the minimal configuration, you can compose the two configs,
testAccCheckIBMDatabaseInstanceMySQLMinimal
and testAccCheckIBMDatabaseInstanceMySQLMinimal_ReadReplica
See MongDB Enterprise https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/ibm/service/database/resource_ibm_database_mongodb_enterprise_test.go#L160-L162
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexhemard have been working on this for a while and cant seem to find out why combining the above is breaking the tests. These are the changes but just looks at the resource_ibm_database_postgresql_test.go
test file as that is what I am trying to get working first
0ab9de7
From what I can tell, the destroy function seems to get executed before the promote step (step 2) so the promote never happens and then we get an expected error that you cant delete leader that has replica. I have read up and that the destroy function should execute after the final step but that doesnt seem to be the case - any ideas?
FYI In the mongo example, there is no step after the combined one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexhemard Pushed updates to tests based on convo yesterday. One change is the sourceInstanceCRN
doesnt actually get set in the test func - so cant pass it as a param in read replica step so I did the same as the mongo which is reference it directly.
I think an enhancement to the Exists function is to return the crn as well so we can use it but probably out of scope for this ticket. Let me know if you want me to change it
6204247
to
0ab9de7
Compare
ec04b92
to
c4135f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Community Note
Relates OR Closes https://github.ibm.com/compose/App/issues/1352
Output from acceptance testing: