Fix failing compute tests which use AccessConfigs (#1383)

This commit is contained in:
Nathan McKinley 2018-04-25 13:26:24 -07:00 committed by GitHub
parent 7e5ce3f679
commit 0a02d8eaef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ func expandAccessConfigs(configs []interface{}) []*computeBeta.AccessConfig {
Type: "ONE_TO_ONE_NAT",
NatIP: data["nat_ip"].(string),
}
if ptr, ok := data["public_ptr_domain_name"]; ok {
if ptr, ok := data["public_ptr_domain_name"]; ok && ptr != "" {
acs[i].SetPublicPtr = true
acs[i].PublicPtrDomainName = ptr.(string)
}

View File

@ -1125,7 +1125,7 @@ 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 {
if ptr, ok := d.GetOk(acPrefix + ".public_ptr_domain_name"); ok && ptr != "" {
ac.SetPublicPtr = true
ac.PublicPtrDomainName = ptr.(string)
}