-
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: Support replica_set_scaling_strategy
in mongodbatlas_advanced_cluster
#2539
Conversation
replica_set_scaling_strategy
in mongodbatlas_cluster
and mongodbatlas_advanced_cluster
replica_set_scaling_strategy
in mongodbatlas_advanced_cluster
APIx bot: a message has been sent to Docs Slack channel |
if err := d.Set("replica_set_scaling_strategy", clusterDescLatest.GetReplicaSetScalingStrategy()); err != nil { | ||
return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "replica_set_scaling_strategy", clusterName, err)) | ||
} |
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.
For the case of both data sources I believe we are only handling the case when the user defines use_replication_spec_per_shard = true
, but if we want to handle all cases we should also consider the other path as done in the resource. Would suggest adjusting configReplicaSetScalingStrategyOldSchema
to use data source without this option so it is captured there as well.
cluster, resp, err := connV2.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() | ||
if err != nil { | ||
if resp != nil && resp.StatusCode == http.StatusNotFound { | ||
d.SetId("") | ||
return nil | ||
} | ||
return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) | ||
} | ||
if err := d.Set("replica_set_scaling_strategy", cluster.GetReplicaSetScalingStrategy()); err != nil { | ||
return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "replica_set_scaling_strategy", clusterName, err)) | ||
} | ||
|
||
zoneNameToZoneIDs, err := getZoneIDsFromNewAPI(ctx, projectID, clusterName, connV2) |
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.
getZoneIDsFromNewAPI
is doing a get to the new API, if we are now doing the call from outside now we can pass the result directly to this function to avoid 2 same calls.
* master: doc: Adds 1.19.0 release upgrade guide (#2564) chore: Updates CHANGELOG.md for #2528 feat: Supports change_stream_options_pre_and_post_images_expire_after_seconds in `mongodbatlas_cluster` and `mongodbatlas_advanced_cluster` (#2528) chore: Disables preview mode for EAR private endpoint so it may be normally accessible (#2571) doc: Adds support for SDK_BRANCH in schema generation (#2562) update git workflow (#2572) chore: Updates CHANGELOG.md for #2566 feat: Adds `mongodbatlas_stream_processor` resource and data sources (#2566) chore: Updates CHANGELOG.md for #2569 chore: Merges Azure KMS Encryption at Rest Private Endpoint feature to master (#2569) chore: Updates CHANGELOG.md for #2568 doc: Includes sync_creation into mongodbatlas_online_archive resource documentation (#2567) fix: Sets correct `zone_id` when `use_replication_spec_per_shard` is false and refactors `replica_set_scaling_strategy` handling with old schema of advanced cluster (#2568) chore: Updates CHANGELOG.md for #2539 feat: Support `replica_set_scaling_strategy` in `mongodbatlas_advanced_cluster` (#2539) adding changelog entry for 1.18.1 to avoid confusion (#2561) # Conflicts: # internal/provider/provider.go
* master: doc: Adds 1.19.0 release upgrade guide (#2564) chore: Updates CHANGELOG.md for #2528 feat: Supports change_stream_options_pre_and_post_images_expire_after_seconds in `mongodbatlas_cluster` and `mongodbatlas_advanced_cluster` (#2528) chore: Disables preview mode for EAR private endpoint so it may be normally accessible (#2571) doc: Adds support for SDK_BRANCH in schema generation (#2562) update git workflow (#2572) chore: Updates CHANGELOG.md for #2566 feat: Adds `mongodbatlas_stream_processor` resource and data sources (#2566) chore: Updates CHANGELOG.md for #2569 chore: Merges Azure KMS Encryption at Rest Private Endpoint feature to master (#2569) chore: Updates CHANGELOG.md for #2568 doc: Includes sync_creation into mongodbatlas_online_archive resource documentation (#2567) fix: Sets correct `zone_id` when `use_replication_spec_per_shard` is false and refactors `replica_set_scaling_strategy` handling with old schema of advanced cluster (#2568) chore: Updates CHANGELOG.md for #2539 feat: Support `replica_set_scaling_strategy` in `mongodbatlas_advanced_cluster` (#2539) adding changelog entry for 1.18.1 to avoid confusion (#2561) # Conflicts: # internal/provider/provider.go
* master: doc: Adds 1.19.0 release upgrade guide (#2564) chore: Updates CHANGELOG.md for #2528 feat: Supports change_stream_options_pre_and_post_images_expire_after_seconds in `mongodbatlas_cluster` and `mongodbatlas_advanced_cluster` (#2528) chore: Disables preview mode for EAR private endpoint so it may be normally accessible (#2571) doc: Adds support for SDK_BRANCH in schema generation (#2562) update git workflow (#2572) chore: Updates CHANGELOG.md for #2566 feat: Adds `mongodbatlas_stream_processor` resource and data sources (#2566) chore: Updates CHANGELOG.md for #2569 chore: Merges Azure KMS Encryption at Rest Private Endpoint feature to master (#2569) chore: Updates CHANGELOG.md for #2568 doc: Includes sync_creation into mongodbatlas_online_archive resource documentation (#2567) fix: Sets correct `zone_id` when `use_replication_spec_per_shard` is false and refactors `replica_set_scaling_strategy` handling with old schema of advanced cluster (#2568) chore: Updates CHANGELOG.md for #2539 feat: Support `replica_set_scaling_strategy` in `mongodbatlas_advanced_cluster` (#2539) adding changelog entry for 1.18.1 to avoid confusion (#2561) # Conflicts: # internal/provider/provider.go
Description
Supports
replica_set_scaling_strategy
inmongodbatlas_advanced_cluster
.Link to any related issue(s): CLOUDP-261476
Type of change:
Required Checklist:
Further comments