-
Notifications
You must be signed in to change notification settings - Fork 319
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
gitlab_project: wait until real deletion #19
Conversation
3cb4cdb
to
46568e3
Compare
46568e3
to
db263f0
Compare
Before
|
After
|
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.
Hey @roidelapluie
Thanks for this PR - I've taken a look and left a comment in-line but this otherwise LGTM :)
Thanks!
gitlab/resource_gitlab_project.go
Outdated
return nil | ||
} | ||
} | ||
time.Sleep(time.Second * 1) |
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'd be good to add a max attempts timeout here, if possible? i.e. try 30 times then raise an error?
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.
I was relying on terraform to do this, e.g. time out?
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.
isnt that a terraform core functionnality?
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.
Terraform exposes this as the context
but I thought it needed to be threaded through? (I may be wrong!)
In general we'd tend to achieve this using StateChangeConf
to ensure it's deleted
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.
I have implemented that. Waiting for your review to merge.
68db236
to
2986296
Compare
@tombuildsstuff is this better? |
|
gitlab/resource_gitlab_project.go
Outdated
return err | ||
} | ||
|
||
// Wait for the datacenter resource to be ready |
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.
Datacenter? I suspect this is dodgy copy and paste.
Deleting a project in Gitlab is an async method. By blocking until the project does not exist anymore, we do not lie to the terraform end user about the status of a deleted project. As a side effet it fixes the acceptances tests. Signed-off-by: Julien Pivotto <[email protected]>
2986296
to
4381a20
Compare
Thanks :) |
gitlab_project: wait until real deletion
Deleting a project in Gitlab is an async method.
By blocking until the project does not exist anymore, we
do not lie to the terraform end user about the status of a
deleted project.
As a side effet it fixes the acceptances tests.
Signed-off-by: Julien Pivotto [email protected]