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

[Terraform] DNS Policies #1108

Merged

Conversation

drebes
Copy link
Member

@drebes drebes commented Dec 26, 2018


[all]

Adds support for Cloud DNS Policies

[terraform]

[terraform-beta]

Adds support for Cloud DNS Policies

[ansible]

[inspec]

@drebes
Copy link
Member Author

drebes commented Dec 26, 2018

This depends on #981.

The TestAccDnsPolicy_update acceptance test is currently failing. There's something with enable_inbound_forwarding that its expansion is not being passed to the PATCH call, so it doesn't get updated server side.

$ make testacc TESTARGS='-run=TestAccDnsPolicy_update' 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccDnsPolicy_update -timeout 120m -ldflags="-X=github.com/terraform-providers/terraform-provider-google-beta/version.ProviderVersion=acc"
?   	github.com/terraform-providers/terraform-provider-google-beta	[no test files]
=== RUN   TestAccDnsPolicy_update
=== PAUSE TestAccDnsPolicy_update
=== CONT  TestAccDnsPolicy_update
--- FAIL: TestAccDnsPolicy_update (67.03s)
    testing.go:538: Step 2 error: After applying this step, the plan was not empty:
        
        DIFF:
        
        UPDATE: google_dns_policy.example-policy
          enable_inbound_forwarding: "true" => "false"
        
        STATE:
        
        google_compute_network.network-1:
          ID = network-1-ojhucy1bz1
          provider = provider.google
          auto_create_subnetworks = false
          description = 
          gateway_ipv4 = 
          ipv4_range = 
          name = network-1-ojhucy1bz1
          project = drebes-playground-alpha-5ae4
          routing_mode = REGIONAL
          self_link = https://www.googleapis.com/compute/v1/projects/drebes-playground-alpha-5ae4/global/networks/network-1-ojhucy1bz1
        google_compute_network.network-2:
          ID = network-2-ojhucy1bz1
          provider = provider.google
          auto_create_subnetworks = false
          description = 
          gateway_ipv4 = 
          ipv4_range = 
          name = network-2-ojhucy1bz1
          project = drebes-playground-alpha-5ae4
          routing_mode = REGIONAL
          self_link = https://www.googleapis.com/compute/v1/projects/drebes-playground-alpha-5ae4/global/networks/network-2-ojhucy1bz1
        google_dns_policy.example-policy:
          ID = example-policy-ojhucy1bz1
          provider = provider.google
          alternative_name_server_config.# = 1
          alternative_name_server_config.0.target_name_servers.# = 1
          alternative_name_server_config.0.target_name_servers.1120708668.ipv4_address = 172.16.1.10
          description = Managed by Terraform
          enable_inbound_forwarding = true
          name = example-policy-ojhucy1bz1
          networks.# = 1
          networks.2937888432.network_url = https://www.googleapis.com/compute/v1/projects/drebes-playground-alpha-5ae4/global/networks/network-1-ojhucy1bz1
          project = drebes-playground-alpha-5ae4
        
          Dependencies:
            google_compute_network.network-1
FAIL
FAIL	github.com/terraform-providers/terraform-provider-google-beta/google-beta	67.071s
?   	github.com/terraform-providers/terraform-provider-google-beta/version	[no test files]
make: *** [testacc] Error 1

@drebes drebes force-pushed the terraform-dns-inbound branch 2 times, most recently from 0027e90 to 2f37ad1 Compare January 8, 2019 20:54
@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.

Copy link
Contributor

@nat-henderson nat-henderson left a comment

Choose a reason for hiding this comment

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

This is frankly delightful - these are some of the most complex resources there are, and this looks great to me. Let's run it through the system and see what we can do about that test failure.

products/dns/api.yaml Outdated Show resolved Hide resolved
@nat-henderson
Copy link
Contributor

Ah, the merge conflict, of course, I see the dependency chain now. I'll wait on that issue to be closed and come back to this one.

@drebes drebes force-pushed the terraform-dns-inbound branch 3 times, most recently from a363812 to 33b273b Compare February 6, 2019 04:25
@rileykarson
Copy link
Member

@ndmckinley: This has been unblocked as #981 is merged.

@drebes
Copy link
Member Author

drebes commented Feb 15, 2019

I will rebase this from master.

@drebes drebes force-pushed the terraform-dns-inbound branch from 33b273b to 66143dd Compare February 15, 2019 23:26
@nat-henderson
Copy link
Contributor

I fixed the problem that caused that test failure - I'll re-run this.

@nat-henderson nat-henderson force-pushed the terraform-dns-inbound branch from 66143dd to 9101e2e Compare March 2, 2019 00:04
@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 9101e2e77475369b85b5a962669af85171545d9b.

Pull request statuses

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

@nat-henderson
Copy link
Contributor

Great, running those tests now.

@nat-henderson
Copy link
Contributor

Looks like updates of

        UPDATE: google_dns_policy.example-policy
          enable_inbound_forwarding: "true" => "false"

don't stick - might need to put "send_empty_value" on that field in the terraform.yaml config?

@drebes drebes force-pushed the terraform-dns-inbound branch from 9101e2e to 718952d Compare March 3, 2019 21:50
@drebes
Copy link
Member Author

drebes commented Mar 3, 2019

Indeed, should be good now with the send_empty_update: true:

$ make testacc TESTARGS='-run=TestAccDnsPolicy'
==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccDnsPolicy -timeout 240m -ldflags="-X=github.com/terraform-providers/terraform-provider-google-beta/version.ProviderVersion=acc"
?   	github.com/terraform-providers/terraform-provider-google-beta	[no test files]
=== RUN   TestAccDnsPolicy_dnsPolicyBasicExample
=== PAUSE TestAccDnsPolicy_dnsPolicyBasicExample
=== RUN   TestAccDnsPolicy_update
=== PAUSE TestAccDnsPolicy_update
=== CONT  TestAccDnsPolicy_dnsPolicyBasicExample
=== CONT  TestAccDnsPolicy_update
--- PASS: TestAccDnsPolicy_dnsPolicyBasicExample (59.44s)
--- PASS: TestAccDnsPolicy_update (64.63s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google-beta/google-beta	64.663s
?   	github.com/terraform-providers/terraform-provider-google-beta/scripts/affectedtests	[no test files]
?   	github.com/terraform-providers/terraform-provider-google-beta/version	[no test files]

@nat-henderson
Copy link
Contributor

Fantastic, sending it through again.

@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, 718952d.

Pull request statuses

terraform-provider-google-beta already has an open PR.
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.

@nat-henderson
Copy link
Contributor

And, testing now.

@nat-henderson
Copy link
Contributor

Tests pass!

@modular-magician modular-magician merged commit 05c353e into GoogleCloudPlatform:master Mar 4, 2019
@drebes drebes deleted the terraform-dns-inbound branch March 4, 2019 22:29
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