fix: fix more lintings
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / CI (pull_request) Failing after 11m17s
CI Workflow / Code coverage report (pull_request) Has been skipped
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 23m54s
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / CI (pull_request) Failing after 11m17s
CI Workflow / Code coverage report (pull_request) Has been skipped
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 23m54s
This commit is contained in:
parent
944b872db7
commit
20593da30b
12 changed files with 42 additions and 42 deletions
|
|
@ -390,7 +390,7 @@ func (r *databaseResource) Update(
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (databaseId)")
|
||||
return
|
||||
}
|
||||
databaseId := int32(databaseId64)
|
||||
databaseId := int32(databaseId64) // nolint:gosec // check is performed above
|
||||
|
||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
||||
ctx = tflog.SetField(ctx, "instance_id", instanceId)
|
||||
|
|
@ -516,7 +516,7 @@ func (r *databaseResource) Delete(
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (databaseId)")
|
||||
return
|
||||
}
|
||||
databaseId := int32(databaseId64)
|
||||
databaseId := int32(databaseId64) // nolint:gosec // check is performed above
|
||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
||||
ctx = tflog.SetField(ctx, "instance_id", instanceId)
|
||||
ctx = tflog.SetField(ctx, "region", region)
|
||||
|
|
|
|||
|
|
@ -439,13 +439,13 @@ func (r *instanceResource) Update(
|
|||
// return
|
||||
//}
|
||||
//
|
||||
//if model.ProjectId.IsNull() || model.ProjectId.IsUnknown() {
|
||||
// if model.ProjectId.IsNull() || model.ProjectId.IsUnknown() {
|
||||
// core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating instance", "projectId is null or unknown")
|
||||
// return
|
||||
//}
|
||||
|
||||
// projectId := model.ProjectId.ValueString()
|
||||
//instanceId := model.InstanceId.ValueString()
|
||||
// instanceId := model.InstanceId.ValueString()
|
||||
projectId := identityData.ProjectID.ValueString()
|
||||
instanceId := identityData.InstanceID.ValueString()
|
||||
region := model.Region.ValueString()
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ func TestAccInstanceWithDatabases(t *testing.T) {
|
|||
// return httptest.NewServer(mux)
|
||||
//}
|
||||
//
|
||||
//func TestUnitResourceCreate(t *testing.T) {
|
||||
// func TestUnitResourceCreate(t *testing.T) {
|
||||
// server := setupMockServer()
|
||||
// defer server.Close()
|
||||
//
|
||||
|
|
@ -449,14 +449,14 @@ func TestAccInstanceWithDatabases(t *testing.T) {
|
|||
//}
|
||||
//
|
||||
//// User resource data
|
||||
//var userResource = map[string]string{
|
||||
// var userResource = map[string]string{
|
||||
// "username": fmt.Sprintf("tfaccuser%s", acctest.RandStringFromCharSet(4, acctest.CharSetAlpha)),
|
||||
// "role": "createdb",
|
||||
// "project_id": testutils.ProjectId,
|
||||
//}
|
||||
//
|
||||
//// Database resource data
|
||||
//var databaseResource = map[string]string{
|
||||
// var databaseResource = map[string]string{
|
||||
// "name": fmt.Sprintf("tfaccdb%s", acctest.RandStringFromCharSet(4, acctest.CharSetAlphaNum)),
|
||||
// "project_id": testutils.ProjectId,
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ func (r *userDataSource) Read(
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (userId)")
|
||||
return
|
||||
}
|
||||
userId := int32(userId64)
|
||||
userId := int32(userId64) // nolint:gosec // check is performed above
|
||||
|
||||
region := r.providerData.GetRegionWithOverride(model.Region)
|
||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ func (r *userResource) Update(
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (userId)")
|
||||
return
|
||||
}
|
||||
userId := int32(userId64)
|
||||
userId := int32(userId64) // nolint:gosec // check is performed above
|
||||
|
||||
// Update existing instance
|
||||
err = r.client.UpdateUserRequest(
|
||||
|
|
@ -518,7 +518,7 @@ func (r *userResource) Delete(
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (userId)")
|
||||
return
|
||||
}
|
||||
userId := int32(userId64)
|
||||
userId := int32(userId64) // nolint:gosec // check is performed above
|
||||
|
||||
// Delete existing record set
|
||||
err := r.client.DeleteUserRequest(ctx, arg.projectId, arg.region, arg.instanceId, userId).Execute()
|
||||
|
|
@ -530,11 +530,11 @@ func (r *userResource) Delete(
|
|||
|
||||
// TODO: Verify deletion
|
||||
// exists, err := r.getUserResource(ctx, &model, arg)
|
||||
//if err != nil {
|
||||
// if err != nil {
|
||||
// core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting user", fmt.Sprintf("Calling API: %v", err))
|
||||
// return
|
||||
//}
|
||||
//if exists {
|
||||
// if exists {
|
||||
// core.LogAndAddError(
|
||||
// ctx, &resp.Diagnostics, "Error deleting user",
|
||||
// fmt.Sprintf("User ID '%v' resource still exists after deletion", model.UserId.ValueInt64()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue