generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 55
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: save resource state when failing on subtasks #289
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ddebko
requested review from
johanbrandhorst,
louisruch and
tmessi
and removed request for
louisruch
October 17, 2022 15:54
ddebko
force-pushed
the
ddebko-fix-state
branch
2 times, most recently
from
October 17, 2022 18:19
4bed53b
to
153c317
Compare
ddebko
force-pushed
the
ddebko-fix-state
branch
from
October 17, 2022 18:32
153c317
to
76b49ab
Compare
ddebko
force-pushed
the
ddebko-fix-state
branch
from
October 17, 2022 18:56
76b49ab
to
9ee3255
Compare
ddebko
force-pushed
the
ddebko-fix-state
branch
from
October 17, 2022 21:35
9ee3255
to
8182404
Compare
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.
😅
ddebko
force-pushed
the
ddebko-fix-state
branch
from
October 17, 2022 22:47
8182404
to
5eb237d
Compare
ddebko
force-pushed
the
ddebko-fix-state
branch
from
October 17, 2022 23:08
5eb237d
to
b12dc4e
Compare
ddebko
force-pushed
the
ddebko-fix-state
branch
from
October 17, 2022 23:32
b12dc4e
to
551bcae
Compare
johanbrandhorst
approved these changes
Oct 17, 2022
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.
It's beautiful :it's-so-beautiful:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
The following resources have one or more subtasks when applying the terraform creation task: group, host set, role, target, user. For example, when creating a target the following steps are invoked:
Each step is a different call to the boundary API. Currently there is a bug where if I provide an invalid credential source to the target the state file does not save any information about the target. When resolving the error in the terraform source file and then reapplying the changes, boundary will return the following error:
unique name violation
. This is because we only set the state at the end of the creation function and the state is never set if the happy path is not followed.Solution:
Invoke the resource
setFrom{Resource Name}ResponseMap()
function when a subtasks fails. This allows us to correctly sync the resource's state to what we have in Boundary. I also validated the changes by building the provider locally and testing it out against a boundary dev instance.