-
Notifications
You must be signed in to change notification settings - Fork 675
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 deleting instances with replicant attribute set #5176
Conversation
@ismirlia could you add the acceptance test for this? |
@yussufsh @michaelkad so right now, update only updates the original instance and not the replicants. Should the goal be to update the replicants as well when any update is made? So this could work for some types of updates potentially, but it couldn't work for others. Like for example you couldn't update the name to match for all of them. I'm still working on running the tests, got delayed by the reapply quesion @surajsbharadwaj had. |
@yussufsh updating all of them in one go is also not currently how the API/CLI work in that regard either. |
…m into replicant-delete
…m into replicant-delete
…m into replicant-delete
err = client.Delete(instanceID) | ||
if err != nil { | ||
return diag.FromErr(err) | ||
} | ||
|
||
_, err = isWaitForPIInstanceDeleted(ctx, client, instanceID) | ||
if err != nil { | ||
return diag.FromErr(err) | ||
_, err = isWaitForPIInstanceDeleted(ctx, client, instanceID) |
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.
If instead of delete-wait and loop again, can we have two loops? One loop will delete all the instances and the other loop will check the deletion status. This will save lots of time.
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.
Made changes.
…m into replicant-delete
…m into replicant-delete
…m into replicant-delete
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.
lgtm
@ismirlia if an update is not supported can we add a statement in the doc? I am not sure why updating the replicants is not supported. Should be using the same logic as create/delete. |
Updating the replicants is not really supported by the semantics of the API. This multi-delete approach is already stretching the supported capabilities of what this resource should do. The markdown file needs to be updated? pi_instance.html.markdown? |
I understand but then it is always a possibility that user updates the instance details and expect every replicant is getting updated. Imagine if user changes the memory to reduce cost over 50 instances for example, getting to know after some days that changes did not happen and incurred avoidable expenses. |
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.
lgtm
When the pi_replicant field is set in terraform it creates a bunch of vms as expected, but terraform destroy does not delete these.
This fixes: #5168