diff --git a/CHANGELOG.md b/CHANGELOG.md index 71efbca345..7b9ba3e789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ -## [v1.4.6-pre.1](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.4.6-pre.1) (2022-09-15) +## [v1.4.6](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.4.6) (2022-09-19) -[Full Changelog](https://github.com/mongodb/terraform-provider-mongodbatlas/compare/v1.4.5...v1.4.6-pre.1) +[Full Changelog](https://github.com/mongodb/terraform-provider-mongodbatlas/compare/v1.4.5...v1.4.6) **Fixed** - INTMDB-387 - [Terraform] Enable Azure NVME for Atlas Dedicated clusters [\#833](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/833) diff --git a/mongodbatlas/resource_mongodbatlas_advanced_cluster.go b/mongodbatlas/resource_mongodbatlas_advanced_cluster.go index b1d90e1d19..3f0f2df10c 100644 --- a/mongodbatlas/resource_mongodbatlas_advanced_cluster.go +++ b/mongodbatlas/resource_mongodbatlas_advanced_cluster.go @@ -315,12 +315,10 @@ func resourceMongoDBAtlasAdvancedClusterCreate(ctx context.Context, d *schema.Re request.EncryptionAtRestProvider = v.(string) } - if _, ok := d.GetOk("labels"); ok { - if containsLabelOrKey(expandLabelSliceFromSetSchema(d), defaultLabel) { - return diag.FromErr(fmt.Errorf("you should not set `Infrastructure Tool` label, it is used for internal purposes")) - } - request.Labels = append(expandLabelSliceFromSetSchema(d), defaultLabel) + if _, ok := d.GetOk("labels"); ok && containsLabelOrKey(expandLabelSliceFromSetSchema(d), defaultLabel) { + return diag.FromErr(fmt.Errorf("you should not set `Infrastructure Tool` label, it is used for internal purposes")) } + request.Labels = append(expandLabelSliceFromSetSchema(d), defaultLabel) if v, ok := d.GetOk("mongo_db_major_version"); ok { request.MongoDBMajorVersion = formatMongoDBMajorVersion(v.(string)) diff --git a/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go b/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go index aa8005aa46..244f3dffc6 100644 --- a/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go +++ b/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go @@ -48,6 +48,7 @@ func TestAccResourceMongoDBAtlasAdvancedCluster_basicTenant(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "name", rNameUpdated), resource.TestCheckResourceAttrSet(resourceName, "replication_specs.#"), resource.TestCheckResourceAttrSet(resourceName, "replication_specs.0.region_configs.#"), + resource.TestCheckResourceAttr(resourceName, "labels.#", "0"), ), }, {