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

Correctly handle deletion outside of terraform #924

Merged
merged 3 commits into from Mar 8, 2022

Conversation

timofurrer
Copy link
Member

This change fixes the read function of the following resources to properly handle out of bound deletions:

  • gitlab_project
  • gitlab_project_badge
  • gitlab_group_badge

In case a resource is deleted outside of terraform the tf state drift and we need to remove it if the read function received a 404.

@armsnyder any ideas for how to test this in a non-hacky way?

Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

lgtm. For testing, each TestStep has a PreConfig field you can use to run code like deleting the resource upstream.

@timofurrer
Copy link
Member Author

For testing, each TestStep has a PreConfig field you can use to run code like deleting the resource upstream.

Ah yes, right! I think I'll address this later in #205

@timofurrer timofurrer merged commit d99380e into gitlabhq:main Mar 8, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
provider resource Adds or modifies a resource size/S
2 participants