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

feat: Adds new advanced_configuration.0.default_max_time_ms attribute to mongodbatlas_advanced_cluster resource and data sources #2825

Merged
merged 18 commits into from
Dec 10, 2024
Prev Previous commit
Next Next commit
make optional
maastha committed Nov 26, 2024
commit 78e7a5fd12fdeabc4e1a1f24b7c3c8c456f0d78c
Original file line number Diff line number Diff line change
@@ -269,7 +269,6 @@
"default_max_time_ms": {
Type: schema.TypeInt,
Optional: true,
Copy link
Collaborator Author

@maastha maastha Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed with upstream this is expected to be user-managed, hence keeping optional

Computed: true,
},
},
},
@@ -521,7 +520,7 @@
flattenedProcessArgs[0]["change_stream_options_pre_and_post_images_expire_after_seconds"] = p.GetChangeStreamOptionsPreAndPostImagesExpireAfterSeconds()
}

// if v := p.DefaultMaxTimeMS; v == nil {

Check failure on line 523 in internal/service/advancedcluster/model_advanced_cluster.go

GitHub Actions / lint

commentedOutCode: may want to remove commented-out code (gocritic)
// flattenedProcessArgs[0]["default_max_time_ms"] = -1 // default in schema, otherwise user gets drift detection
// } else {
// flattenedProcessArgs[0]["default_max_time_ms"] = p.GetDefaultMaxTimeMS()
@@ -875,7 +874,7 @@
if _, ok := d.GetOkExists("advanced_configuration.0.default_max_time_ms"); ok {
res.DefaultMaxTimeMS = conversion.Pointer(cast.ToInt(p["default_max_time_ms"]))

// if defaultMaxTime := cast.ToInt64(p["default_max_time_ms"]); defaultMaxTime != 0 {

Check failure on line 877 in internal/service/advancedcluster/model_advanced_cluster.go

GitHub Actions / lint

commentedOutCode: may want to remove commented-out code (gocritic)
// res.DefaultMaxTimeMS = conversion.Pointer(cast.ToInt(p["default_max_time_ms"]))
// } else {
// log.Printf(ErrorClusterSetting, `default_max_time_ms`, "", cast.ToString(defaultMaxTime))

Unchanged files with check annotations Beta

return diag.FromErr(fmt.Errorf(errorConfigUpdate, cluster.GetName(), err))
}
_, _, err = connV2.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, cluster.GetName(), &params).Execute()
// log.Println(tmp)

Check failure on line 506 in internal/service/advancedcluster/resource_advanced_cluster.go

GitHub Actions / lint

commentedOutCode: may want to remove commented-out code (gocritic)
if err != nil {
return diag.FromErr(fmt.Errorf(errorConfigUpdate, cluster.GetName(), err))
}