Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into cloud-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sarunask committed Jan 6, 2018
2 parents ee5da4a + a767b11 commit ea9f204
Show file tree
Hide file tree
Showing 21 changed files with 4,961 additions and 3,059 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ IMPROVEMENTS:
* compute: More descriptive error message for health check not found in `google_compute_target_pool` [GH-883]
* container: Don't recreate container_cluster when maintenance_window changes [GH-893]
* dataproc: Add "internal IP only" support for Dataproc clusters [GH-837]
* all: Make provider-wide region optional [GH-916]

BUG FIXES:
* compute: Suppress diff for equivalent value in `google_compute_disk` image field [GH-884]
* compute: Read IAP settings properly in `google_compute_backend_service` [GH-907]
* storage: Fix bug blocking the update of a storage object if its content is dynamic/interpolated. [GH-848]
* storage: Fix bug preventing the removal of lifecycle rules for a `google_storage_bucket`. [GH-850]
* compute: Fix bug causing a crash when specifying unknown network in `google_compute_network_peering` [GH-918]
* storage: Fix bug blocking the update of a storage object if its content is dynamic/interpolated [GH-848]
* storage: Fix bug preventing the removal of lifecycle rules for a `google_storage_bucket` [GH-850]
* all: Fix bug causing a perpetual diff when using provider-default zone [GH-914]

## 1.4.0 (December 11, 2017)

Expand Down
2 changes: 2 additions & 0 deletions google/data_source_google_compute_instance_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ func dataSourceGoogleComputeInstanceGroup() *schema.Resource {
"zone": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"project": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"description": {
Expand Down
2 changes: 1 addition & 1 deletion google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Provider() terraform.ResourceProvider {

"region": &schema.Schema{
Type: schema.TypeString,
Required: true,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_REGION",
"GCLOUD_REGION",
Expand Down
7 changes: 7 additions & 0 deletions google/resource_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func resourceBigtableInstance() *schema.Resource {
"zone": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down Expand Up @@ -152,6 +153,11 @@ func resourceBigtableInstanceRead(d *schema.ResourceData, meta interface{}) erro
return err
}

zone, err := getZone(d, config)
if err != nil {
return err
}

c, err := config.bigtableClientFactory.NewInstanceAdminClient(project)
if err != nil {
return fmt.Errorf("Error starting instance admin client. %s", err)
Expand All @@ -167,6 +173,7 @@ func resourceBigtableInstanceRead(d *schema.ResourceData, meta interface{}) erro
}

d.Set("project", project)
d.Set("zone", zone)
d.Set("name", instance.Name)
d.Set("display_name", instance.DisplayName)

Expand Down
1 change: 1 addition & 0 deletions google/resource_compute_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func resourceComputeAutoscaler() *schema.Resource {
"zone": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down
7 changes: 3 additions & 4 deletions google/resource_compute_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func resourceComputeDisk() *schema.Resource {
"zone": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down Expand Up @@ -306,12 +307,10 @@ func resourceComputeDiskRead(d *schema.ResourceData, meta interface{}) error {
disk = resource.(*compute.Disk)
}

zoneUrlParts := strings.Split(disk.Zone, "/")
typeUrlParts := strings.Split(disk.Type, "/")
d.Set("name", disk.Name)
d.Set("self_link", disk.SelfLink)
d.Set("type", typeUrlParts[len(typeUrlParts)-1])
d.Set("zone", zoneUrlParts[len(zoneUrlParts)-1])
d.Set("type", GetResourceNameFromSelfLink(disk.Type))
d.Set("zone", GetResourceNameFromSelfLink(disk.Zone))
d.Set("size", disk.SizeGb)
d.Set("users", disk.Users)
if disk.DiskEncryptionKey != nil && disk.DiskEncryptionKey.Sha256 != "" {
Expand Down
2 changes: 2 additions & 0 deletions google/resource_compute_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ func resourceComputeInstance() *schema.Resource {
"zone": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down Expand Up @@ -861,6 +862,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error
d.Set("self_link", ConvertSelfLinkToV1(instance.SelfLink))
d.Set("instance_id", fmt.Sprintf("%d", instance.Id))
d.Set("project", project)
d.Set("zone", GetResourceNameFromSelfLink(instance.Zone))
d.Set("name", instance.Name)
d.SetId(instance.Name)

Expand Down
2 changes: 2 additions & 0 deletions google/resource_compute_instance_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func resourceComputeInstanceGroup() *schema.Resource {
"zone": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down Expand Up @@ -240,6 +241,7 @@ func resourceComputeInstanceGroupRead(d *schema.ResourceData, meta interface{})
d.Set("network", instanceGroup.Network)
d.Set("size", instanceGroup.Size)
d.Set("project", project)
d.Set("zone", zone)
d.Set("self_link", instanceGroup.SelfLink)

return nil
Expand Down
1 change: 1 addition & 0 deletions google/resource_compute_instance_group_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
"zone": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_network_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func resourceComputeNetworkPeeringRead(d *schema.ResourceData, meta interface{})

network, err := config.clientCompute.Networks.Get(networkFieldValue.Project, networkFieldValue.Name).Do()
if err != nil {
return handleNotFoundError(err, d, fmt.Sprintf("Network %q", network.Name))
return handleNotFoundError(err, d, fmt.Sprintf("Network %q", networkFieldValue.Name))
}

peering := findPeeringFromNetwork(network, peeringName)
Expand Down
7 changes: 7 additions & 0 deletions google/resource_compute_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func resourceComputeSnapshot() *schema.Resource {
"zone": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down Expand Up @@ -160,6 +161,11 @@ func resourceComputeSnapshotRead(d *schema.ResourceData, meta interface{}) error
return err
}

zone, err := getZone(d, config)
if err != nil {
return err
}

snapshot, err := config.clientCompute.Snapshots.Get(
project, d.Id()).Do()
if err != nil {
Expand All @@ -181,6 +187,7 @@ func resourceComputeSnapshotRead(d *schema.ResourceData, meta interface{}) error
d.Set("labels", snapshot.Labels)
d.Set("label_fingerprint", snapshot.LabelFingerprint)
d.Set("project", project)
d.Set("zone", zone)

return nil
}
Expand Down
2 changes: 2 additions & 0 deletions google/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func resourceContainerCluster() *schema.Resource {
"zone": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down Expand Up @@ -622,6 +623,7 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro
d.Set("network", cluster.Network)
d.Set("subnetwork", cluster.Subnetwork)
d.Set("node_config", flattenNodeConfig(cluster.NodeConfig))
d.Set("zone", zoneName)
d.Set("project", project)
if cluster.AddonsConfig != nil {
d.Set("addons_config", flattenClusterAddonsConfig(cluster.AddonsConfig))
Expand Down
2 changes: 2 additions & 0 deletions google/resource_container_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func resourceContainerNodePool() *schema.Resource {
"zone": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"cluster": &schema.Schema{
Expand Down Expand Up @@ -205,6 +206,7 @@ func resourceContainerNodePoolRead(d *schema.ResourceData, meta interface{}) err
d.Set(k, v)
}

d.Set("zone", zone)
d.Set("project", project)

return nil
Expand Down
Loading

0 comments on commit ea9f204

Please sign in to comment.