This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
DestroyAll only works if CreateAll or LoadState were called first #37
Labels
Comments
This should be easy to write a unit test for. We need state to do a destroy, so it makes sense state needs to be set. But if there are cases you can set state and destroy still isn't called, then its definitely a bug. |
@mitchellh I believe #38 reproduces this, or at least it does in so far as trying to use |
Mitchell mentioned he wanted to look into this so I'm going to un-assign myself at this time. |
mitchellh
added a commit
that referenced
this issue
Aug 10, 2021
Fixes #37 This calls Destroy properly on a resource if SetState is manually called. There is a big limitation here in that we don't know the exact proper destroy order to call, but argmapper gets us most likely correct due to state dependencies. And, as the comment in the code states, the ordering doesn't matter for any practical use case we have today since all manual SetStates today are single resources. Hopefully we switch everything to resource manager soon so this doesn't matter.
mitchellh
added a commit
to hashicorp/waypoint
that referenced
this issue
Aug 10, 2021
This brings in the fix for: hashicorp/waypoint-plugin-sdk#37
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
DestroyAll checks for
Order
orcreateState
to be set before attempting to destroy anything, which are only(?) set whenCreateAll
(orLoadState
) is called first. I believe this prevents "manual" cleanup like seen in docker/platform.go and k8s/platform.go. I attempt to replicate this style of deleting resources by setting their state in hashicorp/waypoint#1648 but the correspondingDestroy
methods are never calledThe text was updated successfully, but these errors were encountered: