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

Fix for terraform-provider-google issue 5608 #1750

Merged
merged 2 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion google-beta/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,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 @@ -1331,6 +1336,7 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro
}

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

if err := d.Set("resource_usage_export_config", flattenResourceUsageExportConfig(cluster.ResourceUsageExportConfig)); err != nil {
return err
Expand Down Expand Up @@ -1899,8 +1905,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 @@ -707,6 +707,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