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

chore: Updates mongodbatlas_cluster to consume selected processArgs fields from the createCluster/updateCluster APIs #3250

Open
wants to merge 30 commits into
base: CLOUDP-296222-adv_conf_cluster_api
Choose a base branch
from

Conversation

maastha
Copy link
Collaborator

@maastha maastha commented Apr 4, 2025

Description

Updates mongodbatlas_cluster to consume selected processArgs fields from the createCluster/updateCluster APIs.

Link to any related issue(s): CLOUDP-296222

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

dependabot bot and others added 21 commits April 2, 2025 12:46
Bumps [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases)
- [Commits](crazy-max/ghaction-import-gpg@cb9bde2...e89d409)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-import-gpg
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump go.mongodb.org/atlas-sdk

* handle breaking changes in latest SDK version

* fix unit test

* fix unit test

* fixes

* revert changes in search index

* dereference fields now that it's a pointer

---------

Co-authored-by: oarbusi <[email protected]>
Co-authored-by: Oriol Arbusi <[email protected]>
* feat: Supports configuring BYOK encryption on search nodes (#3142)

* use SDK preview in encryption_at_rest

* changelog

* Revert "use SDK preview in encryption_at_rest"

This reverts commit 609c9dc.

* trigger change in EAR

* Revert "trigger change in EAR"

This reverts commit 15794dd.

* Reapply "use SDK preview in encryption_at_rest"

This reverts commit 1c2db30.

* TEMPORARY: send enabled_for_search_nodes = true

* finish resource implementation and tests

* data source implementation and test

* doc update

* default and refactor test

* remove old migration test

* default value in resource

* unit test

---------

Co-authored-by: Oriol Arbusi <[email protected]>

* feat: Adds `encryption_at_rest_provider` to `mongodbatlas_search_deployment` resource and data source (#3152)

* use preview

* add encryption_at_rest_provider computed attribute

* remove check

* dosc

* rename files

* move adv_cluster config out of resources

* fix config

* project id

* add TODO to version

* doc: Updates examples with newly added attributes to `mongodbatlas_search_deployment` and `mongodbatlas_encryption_at_rest` (#3174)

* add new attribute to the example

* examples updates

* nit: end with new line

* fix tf validate

* todos

* PR suggestions + test failure

---------

Co-authored-by: Leo Antoli <[email protected]>
@@ -31,7 +31,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/wI2L/jsondiff v0.6.1
github.com/zclconf/go-cty v1.16.2
go.mongodb.org/atlas v0.37.0
go.mongodb.org/atlas v0.37.1-0.20250402194754-dd09936138bc
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will be replaced with new release version before merge

Copy link
Member

Choose a reason for hiding this comment

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

recommend to add a comment so we don't forget

@maastha maastha changed the base branch from CLOUDP-296222-adv_conf_cluster_api to master April 7, 2025 19:16
@maastha maastha changed the base branch from master to CLOUDP-296222-adv_conf_cluster_api April 7, 2025 19:16
@maastha maastha marked this pull request as ready for review April 8, 2025 13:06
@maastha maastha requested a review from a team as a code owner April 8, 2025 13:06
@maastha
Copy link
Collaborator Author

maastha commented Apr 8, 2025

Will re-run complete acc test group cluster in sometime as dev is unstable right now when creating new projects

@@ -17,3 +17,10 @@ func StringPtr(v string) *string {
}
return nil
}

func SliceFromPtr[T any](slicePtr *[]T) []T {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we have this need elsewhere and we could use there this func as well, or we're already using another approach/func and we can use that instead of creating this func

@@ -228,6 +240,29 @@ func expandTagSliceFromSetSchema(d *schema.ResourceData) []*matlas.Tag {
return res
}

func expandClusterAdvancedConfiguration(d *schema.ResourceData) *matlas.AdvancedConfiguration {
ac := d.Get("advanced_configuration")
if aclist, ok1 := ac.([]any); ok1 && len(aclist) > 0 {
Copy link
Member

Choose a reason for hiding this comment

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

nit: just need check len(aclist) as it won't have elements if there is an error, so you wouldn't need ok1

@@ -508,6 +508,7 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.
AutoScaling: autoScaling,
ProviderSettings: providerSettings,
ReplicationSpecs: replicationSpecs,
Copy link
Member

Choose a reason for hiding this comment

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

there are not test changes, can we add/update tests what would fail before this change but will pass now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants