Skip to content

Commit

Permalink
fix tests, update mongo version to 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinshenker committed Jan 12, 2024
1 parent 12618d7 commit f167af2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion digitalocean/database/resource_database_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ func resourceDigitalOceanDatabaseClusterUpdate(ctx context.Context, d *schema.Re
SizeSlug: d.Get("size").(string),
NumNodes: d.Get("node_count").(int),
}
if v, ok := d.GetOk("storage_size_mib"); ok {

// only include the storage_size_mib in the resize request if it has changed
// this avoids invalid values when plans sizes are increasing that require higher base levels of storage
// excluding this parameter will utilize default base storage levels for the given plan size
if v, ok := d.GetOk("storage_size_mib"); ok && d.HasChange("storage_size_mib") {
v, err := strconv.ParseUint(v.(string), 10, 64)
if err == nil {
opts.StorageSizeMib = v
Expand Down
2 changes: 1 addition & 1 deletion digitalocean/database/resource_database_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ const testAccCheckDigitalOceanDatabaseClusterConfigMongoDB = `
resource "digitalocean_database_cluster" "foobar" {
name = "%s"
engine = "mongodb"
version = "4"
version = "6"
size = "db-s-1vcpu-1gb"
region = "nyc3"
node_count = 1
Expand Down
4 changes: 2 additions & 2 deletions digitalocean/database/resource_database_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ const testAccCheckDigitalOceanDatabaseUserConfigMongo = `
resource "digitalocean_database_cluster" "foobar" {
name = "%s"
engine = "mongodb"
version = "4"
version = "6"
size = "db-s-1vcpu-1gb"
region = "nyc1"
node_count = 1
Expand All @@ -383,7 +383,7 @@ const testAccCheckDigitalOceanDatabaseUserConfigMongoMultiUser = `
resource "digitalocean_database_cluster" "foobar" {
name = "%s"
engine = "mongodb"
version = "4"
version = "6"
size = "db-s-1vcpu-1gb"
region = "nyc1"
node_count = 1
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/database_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "digitalocean_database_cluster" "kafka-example" {
resource "digitalocean_database_cluster" "mongodb-example" {
name = "example-mongo-cluster"
engine = "mongodb"
version = "4"
version = "6"
size = "db-s-1vcpu-1gb"
region = "nyc3"
node_count = 1
Expand Down

0 comments on commit f167af2

Please sign in to comment.