-
Notifications
You must be signed in to change notification settings - Fork 76
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
Vapp creation fix #387
Vapp creation fix #387
Conversation
* deprecate vdc.ComposeRawVApp Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
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.
Is a name change the correct change? The terraform-provider-vcd will be calling ComposeRawVApp in their resource_vcd_vapp.go
Nvm, I looked in the pull requests :)
It's more than a name change. I could not simply change the behavior, because |
I realised today, that the method vdc.ComposeRawVApp doesn't return a task, just an error. If no error occurs, then nil is returned Is deprecation still valid? |
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
I'm sorry, I'm very confused by this resolution. That "fix", does not work vAppContents.Tasks is always nil, at least from my own testing, so the vApp composing is still skipped and could lead to the same 400 errors that were seen before Do you see any logs that show the taks being waited on until success? |
If you look at my answer above, you will see that there are tasks. Not always, but often. I am satisfied that the code is correct. If you have a test that proves otherwise, we'll gladly have a look. |
There is always a task, even if the status is instantly set to success, then it should at least log it. If there is no task, then either
If the task has succeeded, it doesnt hurt to log it |
The task is logged only when the SDK receives it. |
The task is always returned inside the vApp creation response. If it is completed, why not log it? It makes debugging and checking logs for completion of the task a lot simpler. I dont believe a compose vApp task can be completed in a vCloud director quicker than the code be performed. That doesn't sound correct. The fix I added has worked for 100s of real vApp creations at this point and has always had a task to wait for. Am I correct in assuming you're stubbing the requests in test and haven't used it in a real scenario? |
Deprecate
vdc.ComposeRawVApp
(returns task) and replace it withvdc.CreateRawVApp
(returns vApp)Addresses #386