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

Read profile and group from Matchbox to detect drift #68

Closed
wants to merge 4 commits into from

Conversation

Nick-Triller
Copy link
Contributor

@Nick-Triller Nick-Triller commented May 23, 2021

Hello,

currently, terraform-provider-matchbox does not refresh state except when a resource was deleted in Matchbox. The provider always compares the original tfstate with the desired state without taking into account if the content of a resource in Matchbox changed. Consequently, deleting a group / profile / template and recreating it with different content but the same name outside of Terraform can't be detected.

This PR ensures refresh works as expected.

Best
Nick

@Nick-Triller
Copy link
Contributor Author

Rebased on master

@Nick-Triller
Copy link
Contributor Author

Hi @dghubble,
is this change something you would consider?
Best
Nick

@dghubble
Copy link
Member

Maybe in a bit, I haven't had a need for it yet but I appreciate it

@dghubble dghubble changed the title Implement proper resource refresh Read profile and group from Matchbox to detect drift Jul 20, 2022
@dghubble
Copy link
Member

Rebased as 010a7d2, thanks

@dghubble dghubble closed this Jul 20, 2022
dghubble added a commit that referenced this pull request Jul 30, 2022
* Fix "unexpected end of JSON input" error when planning or applying after
a matchbox_group without metadata is created (a common case)
* Group metadata is returned as an empty []byte, so its not valid to try
to parse it as JSON
* Add test coverage and improve testing in general

Regressed by #68
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.

2 participants