-
Notifications
You must be signed in to change notification settings - Fork 111
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
Create node and service if deleted outside of terraform #69
Conversation
That is definitely problematic behavior! Do you mind adding tests for this case? There are some test instructions in the bottom section of the README. To my understanding this is a relatively common case in larger providers if you're looking for an example of how to write a test for it. |
@pearkes I'd love to add tests but I couldn't find an example which deal with pre-populated state. can you help me please? |
I'm also facing the same issue, is there any update about it's fix. |
Hi @Gufran, thanks for the PR! I'm pretty sure I got bite by this bug but I add no time to find the cause when it happened to me. For the tests, you can execute arbitrary code in
|
I thought other resources could have the same issue, tried a random one and sure enough,
We should add tests for this on the others resources. |
This changeset fixes an edge case of hashicorp#33 where if terraform state has consul catalog resource but consul catalog is actually empty the provider will raise an error rather than creating the node or service.
Thanks @remilapeyre for the help with tests. I've also patched the |
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.
Thanks for adding the tests, this look good to me, with the small change I indicated.
Can you just push a new commit on top of your change though rather than amending your commit and force push next time? It makes review easier and keep the discussion during previous reviews meaningfull.
@remilapeyre Done! |
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.
Thanks!
@remilapeyre any idea on when will this be merged? |
Hi @Gufran, I will make a final review and merge tonight. |
Thanks @Gufran for you help 🚀 |
This changeset fixes an edge case of #33 where if terraform state has consul catalog resource but consul catalog is actually empty the provider will raise an error rather than creating the node or service.
Acceptance Tests: