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: Allow empty result when looking for storage integration on refresh #692

Merged
merged 7 commits into from
Nov 30, 2021
Merged

fix: Allow empty result when looking for storage integration on refresh #692

merged 7 commits into from
Nov 30, 2021

Conversation

bneijt
Copy link
Contributor

@bneijt bneijt commented Sep 27, 2021

Trying to refresh the terraform state after deleting an integration, I get the error:
Error: Could not show storage integration: sql: no rows in result set

The issue seems to be that looking for a specific integration does deal with not finding that specific integration, triggering an error instead of allow the refresh flow to continue.

Steps to reproduce:

  • Create a snowflake_storage_integration using the provider
  • Delete the resulting integration
  • Execute terraform refresh to update the state

Expected result:

  • The provider should notice the resource gone and update the state
    Actual result:
  • The provider errors out with the message: Error: Could not show storage integration: sql: no rows in result set

Terraform version: 1.0.7
Provider version: 0.25.19

I'm not a go developer, so this PR probably needs tests.

@bneijt bneijt requested a review from a team as a code owner September 27, 2021 13:31
@bneijt bneijt requested a review from edulop91 September 27, 2021 13:31
@bneijt bneijt requested a review from edulop91 September 28, 2021 07:40
@bneijt bneijt changed the title Allow empty result when looking for storage integration on refresh fix: Allow empty result when looking for storage integration on refresh Sep 28, 2021
@bneijt
Copy link
Contributor Author

bneijt commented Sep 28, 2021

Turns out you can nolonger terraform plan anything if the storage integration from your current state is missing, so I filed a bug to make it more visible to other users.

#696

@alldoami
Copy link
Contributor

alldoami commented Oct 6, 2021

/ok-to-test sha=71d4885

@Snowflake-Labs Snowflake-Labs deleted a comment from edulop91 Oct 6, 2021
@github-actions
Copy link

github-actions bot commented Oct 6, 2021

Integration tests success for 71d4885

@alldoami
Copy link
Contributor

@bneijt could you fix the conflicts and I'll look at it again after? Sorry for the late review!

@alldoami
Copy link
Contributor

/ok-to-test sha=d5a7131

@github-actions
Copy link

Integration tests success for d5a7131

@alldoami
Copy link
Contributor

Thanks for working on this!

@alldoami alldoami merged commit 16363cf into Snowflake-Labs:main Nov 30, 2021
daniepett pushed a commit to daniepett/terraform-provider-snowflake that referenced this pull request Feb 9, 2022
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