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 database_user resource with new SDK #1840
Conversation
@@ -189,9 +188,6 @@ func (r *databaseUserRS) Schema(ctx context.Context, req resource.SchemaRequest, | |||
}, | |||
}, | |||
"scopes": schema.SetNestedBlock{ | |||
PlanModifiers: []planmodifier.Set{ | |||
setplanmodifier.RequiresReplace(), | |||
}, |
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.
no need to replace any more as we can send empty scopes if needed
Roles: conversion.NonEmptyToPtr(NewMongoDBAtlasRoles(rolesModel)), | ||
Labels: conversion.NonEmptyToPtr(NewMongoDBAtlasLabels(labelsModel)), | ||
Scopes: conversion.NonEmptyToPtr(NewMongoDBAtlasScopes(scopesModel)), | ||
Roles: NewMongoDBAtlasRoles(rolesModel), |
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.
all NonEmptyToPtr calls in this resource can be removed, and probably this will happen in all resources
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") | ||
clusterInfo = acc.GetClusterInfo(orgID) |
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.
we don't really need a real cluster to create a database_user
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
@@ -452,6 +468,55 @@ func TestAccConfigRSDatabaseUser_withScopesAndEmpty(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestAccConfigRSDatabaseUser_withLabelsAndEmpty(t *testing.T) { |
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.
func TestAccConfigRSDatabaseUser_withLabelsAndEmpty(t *testing.T) { | |
func TestAccConfigRSDatabaseUser_updateToEmptyLabels(t *testing.T) { |
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.
done, and also for the scopes one
Sensitive: true, | ||
Computed: true, | ||
Sensitive: true, | ||
DeprecationMessage: fmt.Sprintf(constant.DeprecationParamByVersion, "1.16.0"), |
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 you create a Jira issue already targeting 1.16.0 to remind us we have to remove it?
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.
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.
Thanks for creating it, would it be possible to add some more description? At minimum:
- the reference of this PR,
- the fields to remove
otherwise if we do this in say two months we won't remember exactly what to do
Description
Updates database_user resource with new SDK.
Link to any related issue(s): https://jira.mongodb.org/browse/CLOUDP-222697
Type of change:
Required Checklist:
Further comments