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 panic on DatabaseInstance failing to create #357

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

dzoeteman
Copy link
Contributor

Description of your changes

In some cases when a DatabaseInstance fails to create, such as when it cannot create a subnetwork if there's no IP space available, a panic would occur as there's no certificate info in the certSlice. Fixed this by just checking if the certSlice is empty.

Fixes #343

I have:

  • Run make reviewable test to ensure this PR is ready for review. (just ran make test as the rest fails)

How has this code been tested

Tested the following scenarios:

  • Successful creation of DatabaseInstance: confirmed certificate details are still added to status.atProvider.serverCaCert
  • Failed creation does not cause panic anymore and does not add certificate details to status.atProvider.serverCaCert. Status condition is still added with the error from GCP.

In some cases when a DatabaseInstance fails to create, such as when it cannot create a subnetwork, a panic would occur as there's no certificate info in the certSlice.

Signed-off-by: Deniz Zoeteman <dkzoeteman@gmail.com>
@Upbound-CLA
Copy link

Upbound-CLA commented Aug 14, 2023

CLA assistant check
All committers have signed the CLA.

@turkenf
Copy link
Collaborator

turkenf commented Aug 14, 2023

/test-examples="examples/sql/instance.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @dzoeteman, LGTM.

@turkenf turkenf merged commit 29c5ed3 into crossplane-contrib:main Aug 15, 2023
@dzoeteman dzoeteman deleted the sql-panic-fix branch August 17, 2023 02:02
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.

Panic on resource configurator when Cloud SQL database fails to create
3 participants