-
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: Implements tags
and labels
as MapAttribute in advanced_cluster
schema v2
#2996
base: master
Are you sure you want to change the base?
Conversation
@@ -25,7 +25,7 @@ func ToTFMapOfSlices(ctx context.Context, values map[string][]string) (basetypes | |||
} | |||
|
|||
func ToTFMapOfString(ctx context.Context, diags *diag.Diagnostics, values *map[string]string) basetypes.MapValue { //nolint:gocritic // easy usage from sdk fields | |||
if values == nil { | |||
if values == nil || len(*values) == 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.
@EspenAlbert can you confirm this change is ok for container_id ?
func NewTagsObjType(ctx context.Context, input *[]admin.ResourceTag, diags *diag.Diagnostics) types.Set { | ||
if input == nil { | ||
// API Response not consistent, even when not set in POST/PATCH `[]` is returned instead of null | ||
return types.SetValueMust(TagsObjType, 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.
@EspenAlbert do we need to keep this logic to send an empty value instead of null value, or it's ok with the previous change in ToTFMapOfString to treat empty maps as null?
as in mocked tests, with this change we don't send the value to Atlas instead of [] being done now:
- "labels": [],
"mongoDBMajorVersion": "8.0",
@@ -61,4 +60,3 @@
}
- ],
- "tags": []
+ ]
}
tags
and labels
as MapAttribute in advanced_cluster
schema v2
Description
Implements
tags
andlabels
as MapAttribute inadvanced_cluster
schema v2.Link to any related issue(s): CLOUDP-295198
Type of change:
Required Checklist:
Further comments