-
Notifications
You must be signed in to change notification settings - Fork 146
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
Support non-boot disk #434
Conversation
NOTE: This is for mitchellh/vagrant-google#102 |
ping @Temikus .. was hoping to get this in quickly per discussion on other GH issue. |
@criccomini Sorry for the delay, this is a free time project and it’s been a very busy week. I’ll address this Saturday AEDT |
Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #434 +/- ##
==========================================
- Coverage 84.94% 84.92% -0.02%
==========================================
Files 339 339
Lines 5825 5826 +1
==========================================
Hits 4948 4948
- Misses 877 878 +1
Continue to review full report at Codecov.
|
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.
Overall LGTM. See 2 small comments.
{ | ||
:auto_delete => auto_delete, | ||
:boot => true, | ||
:autoDelete => auto_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.
auto_delete
and autoDelete
should be interchangeable in google-api-client
.
Or does auto_delete
not function correctly anymore?
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.
Good catch! Changed to auto_delete
.
get_disk(writable, true, auto_delete) | ||
end | ||
|
||
def get_disk(writable = true, boot = false, auto_delete = false) |
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.
Since we already have disks.get
, I think it'll make more sense to name this get_as_hash
or something similar to avoid confusion, WDYT?
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.
As there is a get_as_boot_disk
, how about get_as_disk
?
@criccomini @whynick1 Ok, looking closer this is already implemented in the lib. The method seems to have just moved to collection method Example:
This is probably what you're looking for, right? |
Hi @Temikus , sorry for the late reply as I was on my vocation😅 I have updated PR regarding your comment. Thanks! For |
@whynick1 No worries! So, I may be misunderstanding something here but I double-checked and am able to create an instance with an attached non-boot disk using this method. Example code:
Return:
Or am I missing something here? |
@Temikus You are right! 👍 Meanwhile, I made some change to vagrant-google to support Please let me know what you think! Thanks! cc @criccomini |
@whynick1 Great! I'll close out this PR in favor of the vagrant one. |
Based on the discuss here vagrant-google, to allow mounting additional (non-boot) disks, we need to make some change accordingly.
Could you take a look at this patch? @Temikus