Skip to content
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

Add import/export custom routes beta feature to network peering #1695

Conversation

marcohelmerich
Copy link
Contributor

As mentionend here: hashicorp/terraform-provider-google#3394
There are new beta features in network peering to promote custom routes through vpcs.

I added the feature flags but was unable to test the changes in terraform and am not sure why...
Terraform seems to use the correct v0.beta api and the fields importCustomRoutes and exportCustomRoutes are there in the api-description.json of v0.beta. But nevertheless there are the following errors:

==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta -v -run=resourceComputeNetworkPeering* -timeout 240m -ldflags="-X=github.com/terraform-providers/terraform-provider-google-beta/version.ProviderVersion=acc"
# github.com/terraform-providers/terraform-provider-google-beta/google-beta [github.com/terraform-providers/terraform-provider-google-beta/google-beta.test]
google-beta/resource_compute_network_peering.go:83:3: unknown field 'ImportCustomRoutes' in struct literal of type "github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v0.beta".NetworksAddPeeringRequest
google-beta/resource_compute_network_peering.go:84:3: unknown field 'ExportCustomRoutes' in struct literal of type "github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v0.beta".NetworksAddPeeringRequest
google-beta/resource_compute_network_peering.go:87:101: cannot use request (type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v0.beta".NetworksAddPeeringRequest) as type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v1".NetworksAddPeeringRequest in argument to config.clientCompute.Networks.AddPeering
google-beta/resource_compute_network_peering.go:116:35: cannot use network (type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v1".Network) as type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v0.beta".Network in argument to findPeeringFromNetwork
google-beta/resource_compute_network_peering.go:156:107: cannot use request (type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v0.beta".NetworksRemovePeeringRequest) as type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v1".NetworksRemovePeeringRequest in argument to config.clientCompute.Networks.RemovePeering
google-beta/resource_compute_network_peering_test.go:84:34: cannot use network (type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v1".Network) as type *"github.com/terraform-providers/terraform-provider-google-beta/vendor/google.golang.org/api/compute/v0.beta".Network in argument to findPeeringFromNetwork
FAIL	github.com/terraform-providers/terraform-provider-google-beta/google-beta [build failed]
make: *** [testacc] Error 2

[all]

[terraform]

[terraform-beta]

Add import/export custom routes beta feature to network peering

[ansible]

[inspec]

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. They will authorize it to run through our CI pipeline, which will generate downstream PRs.

Thanks for your contribution! A human will be with you soon.

@marcohelmerich
Copy link
Contributor Author

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.

What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@rileykarson rileykarson requested a review from tysen May 2, 2019 20:26
Copy link

@tysen tysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @marcohelmerich - thanks for the PR. I've added a few comments that should resolve most of the errors you saw when you attempted to run the tests.

@marcohelmerich
Copy link
Contributor Author

HI @tysen ,
I fixed the mentioned issues. I changed the structure according to the API docs. ( Putting everything under the NetworkPeering-Hash is the prefered way) I left autoCreateRoutes as deprecated and added ExchangeSubnetRoutes, the new prefered parameter. The tests worked for me now.
I needed some time to adjust the code. I am new to go and not used to strongly typed languages anymore.

@marcohelmerich marcohelmerich force-pushed the import_export_routes branch from 5fd971e to 2a28eac Compare May 16, 2019 16:02
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
This PR seems not to have generated downstream PRs before, as of 7f97253.

Pull request statuses

No diff detected in terraform-google-conversion.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#754
depends: hashicorp/terraform-provider-google#3699

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 06a9caa.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants