Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
parkedwards committed Oct 25, 2023
1 parent 0155df0 commit 84eb538
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/provider/resources/workspace_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (r *WorkspaceRoleResource) Schema(_ context.Context, _ resource.SchemaReque
}

// copyWorkspaceRoleToModel copies an api.WorkspaceRole to a WorkspaceRoleDataSourceModel.
func copyWorkspaceRoleToModel(ctx context.Context, role *api.WorkspaceRole, model *WorkspaceRoleResourceModel) diag.Diagnostics {
func copyWorkspaceRoleToModel(_ context.Context, role *api.WorkspaceRole, model *WorkspaceRoleResourceModel) diag.Diagnostics {
model.ID = types.StringValue(role.ID.String())
model.Created = customtypes.NewTimestampPointerValue(role.Created)
model.Updated = customtypes.NewTimestampPointerValue(role.Updated)
Expand All @@ -134,11 +134,12 @@ func copyWorkspaceRoleToModel(ctx context.Context, role *api.WorkspaceRole, mode

// NOTE: here, we'll omit updating the TF state with the scopes returned from the API
// as scopes in Prefect Cloud have a hierarchical structure. This means that children scopes
// can be returned based on what a practioner configures in TF / HCL, which will cause
// can be returned based on what a practitioner configures in TF / HCL, which will cause
// conflicts on apply, as the retrieved state from the API will vary slightly with
// the Terraform configuration. Therefore, the state will hold the user-defined scope parameters,
// which will include any children scopes on the Prefect Cloud side.

//nolint:gocritic
// scopes, diags := types.ListValueFrom(ctx, types.StringType, role.Scopes)
// if diags.HasError() {
// return diags
Expand Down Expand Up @@ -209,7 +210,6 @@ func (r *WorkspaceRoleResource) Read(ctx context.Context, req resource.ReadReque
return
}

// client, err := r.client.ServiceAccounts(model.AccountID.ValueUUID())
client, err := r.client.WorkspaceRoles(model.AccountID.ValueUUID())
if err != nil {
resp.Diagnostics.AddError(
Expand Down Expand Up @@ -368,7 +368,7 @@ func (r *WorkspaceRoleResource) Delete(ctx context.Context, req resource.DeleteR
}
}

// ImportState allows Terraform to start managing a Workspace Role resource
// ImportState allows Terraform to start managing a Workspace Role resource.
func (r *WorkspaceRoleResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
// Retrieve import ID and save to id attribute
resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp)
Expand Down
1 change: 0 additions & 1 deletion internal/provider/resources/workspace_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func TestAccResource_workspace_role(t *testing.T) {
},
},
})

}

func fixtureAccWorkspaceRoleResource(name string) string {
Expand Down
2 changes: 1 addition & 1 deletion internal/testutils/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ provider "prefect" {}
// acceptance testing. The factory function will be invoked for every Terraform
// CLI command executed to create a provider server to which the CLI can
// reattach.
var TestAccProvider = providerserver.NewProtocol6WithError(provider.New())
var TestAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"prefect": TestAccProvider,
}
var TestAccProvider = providerserver.NewProtocol6WithError(provider.New())

0 comments on commit 84eb538

Please sign in to comment.