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 DNS PTR record to Compute Instance #1349

Merged
merged 5 commits into from
Apr 20, 2018

Conversation

nat-henderson
Copy link
Contributor

Fixes #1333.

@nat-henderson
Copy link
Contributor Author

Required a revendor - I'm going to run all the compute tests on this one.

@nat-henderson
Copy link
Contributor Author

[TestAccComputeInstance_PTRRecord] [Test Output]
=== RUN   TestAccComputeInstance_PTRRecord
--- PASS: TestAccComputeInstance_PTRRecord (80.11s)
PASS

Copy link
Contributor

@rosbo rosbo left a comment

Choose a reason for hiding this comment

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

Documentation?

@@ -1120,6 +1125,10 @@ func resourceComputeInstanceUpdate(d *schema.ResourceData, meta interface{}) err
Type: "ONE_TO_ONE_NAT",
NatIP: d.Get(acPrefix + ".nat_ip").(string),
}
if ptr, ok := d.GetOk(acPrefix + ".public_ptr_domain_name"); ok {
ac.SetPublicPtr = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to set SetPublicPtr explicitely to true to turn it off if some was using public_ptr_domain_name and now removes it from their config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really know why the API requires that SetPublicPtr be true and PublicPtrDomainName have the value, rather than just doing a null check on the latter, but the docs are clear about that. Creating the new AccessConfig means that it won't be set unless that's set in the current config - we do a full replace.

Copy link
Contributor

Choose a reason for hiding this comment

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

We got bit a few times by that when in order to disable a feature in update, we had to use ForceSend false and nil values otherwise, the server would keep the value it currently had.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense! I don't think it can happen here at all since we do a full replace. Let me add that to the test to be 100% sure.

@nat-henderson
Copy link
Contributor Author

Test passes, even with imports, so it's definitely not a problem.

@nat-henderson nat-henderson merged commit d3bbfbd into hashicorp:master Apr 20, 2018
@nat-henderson nat-henderson deleted the dns-ptr-record branch April 20, 2018 18:14
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
@ghost
Copy link

ghost commented Nov 18, 2018

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants