You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by bchazalet <gi...@git.apache.org> on 2018/03/08 13:45:23 UTC
[GitHub] libcloud pull request #1179: Allow shared vpc in managed instance group crea...
GitHub user bchazalet opened a pull request:
https://github.com/apache/libcloud/pull/1179
Allow shared vpc in managed instance group creation
## Allow creation of MIG with an instance template whose network and subnetwork are shared from a different project
### Description
It's currently not possible to create a Managed Instance Group with an instance template that creates instances in a network and subnetwork that are shared from a different project.
The problem seems to be that, when parsing the json representing the instance group (in `_to_instancegroup`), the name part of the network (or subnetwork) is extracted from a fully qualified URL, i.e. implictly assuming that the network is under the same project that we are in. But if we're using a shared VPC, the network resource will be under a different project and we must stick to using fully qualified URL.
This PR modifies the `_to_instancegroup` method so that the network and subnetwork values contained in the json representation are used as they are and passed directly to `ex_get_network` and `ex_get_subnetwork` which know how to handle fully qualified resource URLs.
### Status
Done, ready for review. To be honest I am not sure the test I've added is useful, but I am not too sure about how to test this: I'll happily receive feedback.
### Checklist (tick everything that applies)
- [ ] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks)
- [ ] Documentation
- [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [ ] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bchazalet/libcloud allow-shared-vpc-in-instance-group
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/libcloud/pull/1179.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1179
----
commit 5436f492d71eb32c83af5bf69e4c51dad44e9c8b
Author: Boris Chazalet <bc...@...>
Date: 2018-03-07T17:35:13Z
Allow for shared networks in instance groups
By using fully qualified names of networks.
commit ad1587386e0c0aaa05209c38b3f1704032ec05a1
Author: Boris Chazalet <bc...@...>
Date: 2018-03-08T13:22:07Z
Add a test for gce MIG with shared network
----
---
[GitHub] libcloud pull request #1179: Allow shared vpc in managed instance group crea...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/libcloud/pull/1179
---