Skip to content

Commit

Permalink
add check for MaxItems:4 for cluster attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mackenziestarr committed Aug 7, 2019
1 parent 75d8c61 commit 1562921
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions google/resource_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ func expandBigtableClusters(clusters []interface{}, instanceID string) []bigtabl
func resourceBigtableInstanceClusterReorderTypeList(diff *schema.ResourceDiff, meta interface{}) error {
old_count, new_count := diff.GetChange("cluster.#")

// simulate Required:true and MinItems:1 for "cluster"
if new_count.(int) < 1 {
return fmt.Errorf("Error applying diff. Resource definition should contain one or more cluster blocks, got %d blocks", new_count.(int))
// simulate Required:true, MinItems:1, MaxItems:4 for "cluster"
if new_count.(int) < 1 || new_count.(int) > 4 {
return fmt.Errorf("Error applying diff. Resource definition should contain at least one cluster block but no more than four, got %d blocks", new_count.(int))
}

if old_count.(int) != new_count.(int) {
Expand Down

0 comments on commit 1562921

Please sign in to comment.