-
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
refactor: adjust project_api_key to new file structure #1676
Conversation
@@ -108,8 +109,8 @@ func getDataSourcesMap() map[string]*schema.Resource { | |||
"mongodbatlas_api_keys": mongodbatlas.DataSourceAPIKeys(), | |||
"mongodbatlas_access_list_api_key": mongodbatlas.DataSourceAccessListAPIKey(), | |||
"mongodbatlas_access_list_api_keys": mongodbatlas.DataSourceAccessListAPIKeys(), | |||
"mongodbatlas_project_api_key": mongodbatlas.DataSourceProjectAPIKey(), | |||
"mongodbatlas_project_api_keys": mongodbatlas.DataSourceProjectAPIKeys(), | |||
"mongodbatlas_project_api_key": projectapikey.DataSourceProjectAPIKey(), |
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.
[nit-non-blocking] given the decision on one package per resource and to follow the "don't stutter" general recommendation of go
"mongodbatlas_project_api_key": projectapikey.DataSourceProjectAPIKey(), | |
"mongodbatlas_project_api_key": projectapikey.DataSource(), |
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.
this makes sense, will do a followup PR to adjust all of the resources that have already been adjusted to new structure.
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.
nice, thx
mongodbatlas/data_source_org_id.go
Outdated
@@ -42,7 +43,7 @@ func dataSourceMongoDBAtlasOrgIDRead(ctx context.Context, d *schema.ResourceData | |||
for idx, role := range apiKeyOrgList.APIKey.Roles { | |||
if strings.HasPrefix(role.RoleName, "ORG_") { | |||
if err := d.Set("org_id", apiKeyOrgList.APIKey.Roles[idx].OrgID); err != nil { | |||
return diag.Errorf(ErrorProjectSetting, `org_id`, root.APIKey.ID, err) | |||
return diag.Errorf(projectapikey.ErrorProjectSetting, `org_id`, root.APIKey.ID, 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.
this error seems to be defined in the wrong package
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.
yeah this message was not accurate, adjusted and left a new constant to help with consistency in error messages
…setting attribute errors
|
the failing test is the flaky test so feel free to merge even if that failing test |
Description
Link to any related issue(s): INTMDB-1387
Type of change:
Required Checklist:
Further comments