-
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
chore: Merge with latest master changes updating SDK to v20240530002 #2390
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
bfc18aa
doc: Updates `mongodbatlas_global_cluster_config` doc about self-mana…
lantoli 78e6eba
test: Unifies Azure and GCP networking tests (#2371)
lantoli c647bf2
chore: Updates examples link in index.html.markdown for v1.17.3 release
svc-apix-Bot 1fad9f4
chore: Updates CHANGELOG.md header for v1.17.3 release
svc-apix-Bot 45bc5e5
doc: Updates Terraform Compatibility Matrix documentation (#2370)
svc-apix-Bot 7068f36
use ComposeAggregateTestCheckFunc (#2375)
lantoli 27ca92a
chore: Updates asdf to TF 1.9.0 and compatibility matrix body (#2376)
lantoli ac3f1fd
fix: stale.yaml gh action (#2379)
andreaangiolillo 31d4381
doc: Updates alert-config examples (#2378)
EspenAlbert f2078c5
chore: Updates Atlas Go SDK (#2380)
svc-apix-Bot 2b82c1a
chore: Bump github.com/aws/aws-sdk-go from 1.54.8 to 1.54.13 (#2383)
dependabot[bot] 15143f0
chore: Bump amannn/action-semantic-pull-request from 5.5.2 to 5.5.3 (…
dependabot[bot] d6ac0c8
test: Improves tests for mongodbatlas_search_index (#2384)
lantoli 789f38a
chore: Updates nightly tests to TF 1.9.x (#2386)
lantoli 5dffb29
fix: Emptying cloud_back_schedule "copy_settings" (#2387)
EspenAlbert 7de7e64
chore: Updates CHANGELOG.md for #2387
svc-apix-Bot 10945ce
Merge remote-tracking branch 'origin/master' into CLOUDP-260124-merge
AgustinBettati 889152f
fixing merge conflicts and adopting preview version
AgustinBettati 2288b94
chore: Updates delete logic for `mongodbatlas_search_deployment` (#2389)
lantoli 66150de
add test for symmetric sharded cluster using old schema and skip rela…
AgustinBettati 9e4d275
Merge remote-tracking branch 'origin/master' into CLOUDP-260124-merge
AgustinBettati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
resource/mongodbatlas_cloud_backup_schedule: Updates `copy_settings` on changes (even when empty) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
golang 1.22.4 | ||
terraform 1.8.5 | ||
terraform 1.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package conversion | ||
|
||
import "reflect" | ||
|
||
// HasElementsSliceOrMap checks if param is a non-empty slice or map | ||
func HasElementsSliceOrMap(value any) bool { | ||
v := reflect.ValueOf(value) | ||
if v.Kind() == reflect.Slice || v.Kind() == reflect.Map { | ||
return v.Len() > 0 | ||
} | ||
return false | ||
} | ||
|
||
// ToAnySlicePointer converts to a slice pointer of any as needed in some Atlas SDK Go structs | ||
func ToAnySlicePointer(value *[]map[string]any) *[]any { | ||
if value == nil { | ||
return nil | ||
} | ||
ret := make([]any, len(*value)) | ||
for i, item := range *value { | ||
ret[i] = item | ||
} | ||
return &ret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package conversion_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestHasElementsSliceOrMap(t *testing.T) { | ||
testCasesTrue := map[string]any{ | ||
"slice": []string{"hi"}, | ||
"map": map[string]string{"hi": "there"}, | ||
"int int map": map[int]int{1: 2}, | ||
"double map": map[string]map[string]string{ | ||
"hi": {"there": "bye"}, | ||
}, | ||
} | ||
testCasesFalse := map[string]any{ | ||
"nil": nil, | ||
"empty slice": []string{}, | ||
"empty map": map[string]string{}, | ||
"empty int int map": map[int]int{}, | ||
"not a collection but with len": "hello", | ||
"random object": 123, | ||
} | ||
for name, value := range testCasesTrue { | ||
t.Run(name, func(t *testing.T) { | ||
assert.True(t, conversion.HasElementsSliceOrMap(value)) | ||
}) | ||
} | ||
for name, value := range testCasesFalse { | ||
t.Run(name, func(t *testing.T) { | ||
assert.False(t, conversion.HasElementsSliceOrMap(value)) | ||
}) | ||
} | ||
} | ||
|
||
func TestToAnySlicePointer(t *testing.T) { | ||
testCases := map[string]*[]map[string]any{ | ||
"nil": nil, | ||
"empty": {}, | ||
"one element": {{"hi": "there"}}, | ||
"more complex": { | ||
{"hi": "there"}, | ||
{"bye": 1234}, | ||
}, | ||
} | ||
for name, value := range testCases { | ||
t.Run(name, func(t *testing.T) { | ||
ret := conversion.ToAnySlicePointer(value) | ||
if ret == nil { | ||
assert.Nil(t, value) | ||
} else { | ||
assert.NotNil(t, ret) | ||
assert.Equal(t, len(*value), len(*ret)) | ||
for i := range *value { | ||
assert.Equal(t, (*value)[i], (*ret)[i]) | ||
} | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
v20231115014
is preserved to use old cluster endpointsv20240530002
is adjusted to use lastest preview which includes new cluster API