-
Notifications
You must be signed in to change notification settings - Fork 178
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: Supports config_server_type
and config_server_management_mode
in advanced_cluster
#2670
feat: Supports config_server_type
and config_server_management_mode
in advanced_cluster
#2670
Conversation
…e` in advanced_cluster
} else if d.HasChange("replica_set_scaling_strategy") || d.HasChange("redact_client_log_data") { | ||
waitOnUpdate = true | ||
} | ||
if d.HasChange("replica_set_scaling_strategy") || d.HasChange("redact_client_log_data") || d.HasChange("config_server_management_mode") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: supports updating both old cluster attributes and new attributes when using old SDK
if _, _, err := connV2.ClustersApi.UpdateCluster(ctx, projectID, clusterName, request).Execute(); err != nil { | ||
return diag.FromErr(fmt.Errorf(errorUpdate, clusterName, err)) | ||
} | ||
waitOnUpdate = true | ||
} | ||
if waitOnUpdate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use waitOnUpdateToFinish
at the end instead of doing it twice inside each if
@@ -555,12 +560,12 @@ func TestAccClusterAdvancedClusterConfig_symmetricShardedOldSchema(t *testing.T) | |||
CheckDestroy: acc.CheckDestroyCluster, | |||
Steps: []resource.TestStep{ | |||
{ | |||
Config: configShardedOldSchemaMultiCloud(orgID, projectName, clusterName, 2, "M10"), | |||
Check: checkShardedOldSchemaMultiCloud(clusterName, 2, "M10", false), | |||
Config: configShardedOldSchemaMultiCloud(orgID, projectName, clusterName, 2, "M10", &configServerManagementModeFixedToDedicated), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Choosing to only test for the old schema as there is extra logic there.
- Choosing to re-use existing test as we need a sharded cluster (also picked a test without migration tests since we are introducing a new field)
APIx bot: a message has been sent to Docs Slack channel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -0,0 +1,11 @@ | |||
```release-note:enhancement | |||
resource/mongodbatlas_advanced_cluster: Adds new `config_server_management_mode` and `config_server_type` fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
knit: I think it's ok although in other occasions we've added a line per field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if cluster.ConfigServerManagementMode != nil { | ||
if err := d.Set("config_server_management_mode", *cluster.ConfigServerManagementMode); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we simplify this by using SDK getter functions? Same for above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were right. Changed in c38307c
I thought we didn't want to update state when the user hasn't set those fields before
mongo_db_major_version = "8" | ||
config_server_management_mode = %[1]q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we clarify in docs that this attribute requires mongodb version > 8 and cluster must be sharded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can find the doc updates here: #2677 it mentions sharded.
About version > 8, that is only for embedded, so the field is still valid on earlier versions but it will always be direct.
…nd `config_server_type` (#2677) * chore: add docs for `config_server_management_mode` and `config_server_type` * Update docs/data-sources/advanced_cluster.md Co-authored-by: kyuan-mongodb <[email protected]> * Update docs/data-sources/advanced_clusters.md Co-authored-by: kyuan-mongodb <[email protected]> * Update docs/resources/advanced_cluster.md Co-authored-by: kyuan-mongodb <[email protected]> --------- Co-authored-by: kyuan-mongodb <[email protected]>
* master: (44 commits) Remove RemoveResource from Create and Update (#2694) sleep first time only (#2696) fix: Ensures event_trigger `disabled` is included in the PUT payload (#2690) chore: Bump srvaroa/labeler from 1.11.0 to 1.11.1 (#2695) build(deps): bump go.mongodb.org/atlas-sdk (#2686) fix: Avoids setting organization id to empty when the USER_IS_NOT_FOUND (#2684) doc: Corrects default value of `auto_scaling_disk_gb_enabled` (#2683) chore: Reminder to log test failures (#2688) chore: Updates CHANGELOG.md for #2670 feat: Supports `config_server_type` and `config_server_management_mode` in advanced_cluster (#2670) chore: Creates `advancedclustertpf` package for new implementation (#2679) chore: Removes deprecation warnings for `labels` in cluster/adv_cluster (#2678) doc: Adjusts `redact_client_log_data` doc (#2676) chore: Adds sleep in tests to avoid out of capacity errors (#2674) refactor: Adjust type of set structure in team update logic (#2675) chore: Updates CHANGELOG.md header for v1.21.1 release chore: Updates examples link in index.md for v1.21.1 release build(deps): bump go.mongodb.org/atlas-sdk (#2672) doc: Fixes Public -> Private Preview and adds contact link. (#2671) chore: Updates CHANGELOG.md for #2669 ...
Description
Link to any related issue(s): CLOUDP-228611
Doc updates done in #2677
Type of change:
Required Checklist:
Further comments