Skip to content

Commit

Permalink
upstream /pull/5647 (#3128) (#5680)
Browse files Browse the repository at this point in the history
* Docs for container_cluster label_fingerprint attribute

* Include label fingerprint in resource label update requests for GKE
clusters.

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Feb 14, 2020
1 parent 0162a3b commit d8a5f48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/3128.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
10 changes: 9 additions & 1 deletion google/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,11 @@ func resourceContainerCluster() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
},

"label_fingerprint": {
Type: schema.TypeString,
Computed: true,
},

"default_max_pods_per_node": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -1086,6 +1091,7 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro
}

d.Set("resource_labels", cluster.ResourceLabels)
d.Set("label_fingerprint", cluster.LabelFingerprint)

return nil
}
Expand Down Expand Up @@ -1541,8 +1547,10 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er

if d.HasChange("resource_labels") {
resourceLabels := d.Get("resource_labels").(map[string]interface{})
labelFingerprint := d.Get("label_fingerprint").(string)
req := &containerBeta.SetLabelsRequest{
ResourceLabels: convertStringMap(resourceLabels),
ResourceLabels: convertStringMap(resourceLabels),
LabelFingerprint: labelFingerprint,
}
updateF := func() error {
name := containerClusterFullName(project, location, clusterName)
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/container_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@ exported:
* `instance_group_urls` - List of instance group URLs which have been assigned
to the cluster.

* `label_fingerprint` - The fingerprint of the set of labels for this cluster.

* `maintenance_policy.0.daily_maintenance_window.0.duration` - Duration of the time window, automatically chosen to be
smallest possible in the given scenario.
Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format "PTnHnMnS".
Expand Down

0 comments on commit d8a5f48

Please sign in to comment.