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

Support delete for network peering #2038

Merged

Conversation

chrisst
Copy link
Contributor

@chrisst chrisst commented Jul 11, 2019

Refactor service networking connection

Change Read to remove from state instead of erroring if not found.
Added the 'peering' computed filed to use as a reference key for calls to the
networking resources.
Support Delete by calling 'removePeering' on the associated Network

fixes hashicorp/terraform-provider-google#3979

Release Note for Downstream PRs (will be copied)

`google_service_networking_connection` correctly delete the connection when the resource is destroyed.

@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 468b1b0.

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#935
depends: hashicorp/terraform-provider-google#4003

@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, de5a811.

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.


res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
if err != nil {
return fmt.Errorf("Error removing connection from network %s: %s", d.Id(), err)
Copy link
Contributor

Choose a reason for hiding this comment

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

handleNotFoundError maybe?

parentService := "services/" + parent
networkName := fmt.Sprintf("projects/%s/global/networks/%s", project, network)


Copy link
Contributor

Choose a reason for hiding this comment

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

-extra line

Copy link
Contributor

@craigdbarber craigdbarber left a comment

Choose a reason for hiding this comment

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

LGTM

@chrisst chrisst force-pushed the delete-network-peering branch from de5a811 to 6417766 Compare July 11, 2019 23:27
@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, 6417766.

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.

chrisst added 4 commits July 11, 2019 23:47
Change Read to remove from state instead of erroring if not found.
Added the 'peering' computed filed to use as a reference key for calls to the
networking resources.
Support Delete by calling 'removePeering' on the associated Network
@modular-magician modular-magician force-pushed the delete-network-peering branch from 6417766 to 6d993ba Compare July 11, 2019 23:47
@modular-magician modular-magician merged commit 8f64898 into GoogleCloudPlatform:master Jul 11, 2019
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.

google_service_networking_connection not removed from GCP on destroy
5 participants