-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 Google instance template creation for preemptible VM #4834
Fix Google instance template creation for preemptible VM #4834
Conversation
This LGTM - would like a double check from @lwander to be sure though. |
forceSendFieldsScheduling = append(forceSendFieldsScheduling, "Preemptible") | ||
if vp == true { | ||
instanceProperties.Scheduling.OnHostMaintenance = "TERMINATE" | ||
forceSendFieldsScheduling = append(forceSendFieldsScheduling, "OnHostMaintenance") |
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.
You allocate the capacity for this slice as 3
, but you potentially add 4
items. This can cause runtime panic. I would recommend only placing "OnHostMaintenance"
into ForceSendFields
once, to avoid sending it twice.
Good catch and fix! Thanks for doing this @erobert-c; once you address the comments it's ready to be merged! |
Hi, Thanks for the review, I'll fix those most probably beginning of next week. |
8e99989
to
92d5352
Compare
Hi @lwander, I tried to integrate your feedbacks, squashed the commits and rebased on master. Don't hesitate to tell if you'd like me to change something else. Cheers |
LGTM! |
…ible Fix Google instance template creation for preemptible VM
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hi there,
This commit should allow the creation of preemptible instance template in google compute engine. Currently, while trying to create such template, we get the following error:
Here is a simple template to reproduce the issue
Tests results with
make test TEST=./builtin/providers/google/
are still good.Cheers