Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ichung08 committed Aug 23, 2024
1 parent dd5c6f3 commit 1aaaf46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

- [Terraform](https://developer.hashicorp.com/terraform/downloads) >= 1.0
- [Terraform](https://developer.hashicorp.com/terraform/downloads) >= 1.7
- [Go](https://golang.org/doc/install) >= 1.21

## Building The Provider
Expand Down
3 changes: 2 additions & 1 deletion internal/provider/common/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ func ValidateWorkspaceDeploymentRoles(ctx context.Context, input ValidateWorkspa
deploymentWorkspaceIds := lo.Map(listDeployments.JSON200.Deployments, func(deployment platform.Deployment, _ int) string {
return deployment.WorkspaceId
})
deploymentWorkspaceIds = lo.Uniq(deploymentWorkspaceIds)

// get list of workspaceIds
workspaceIds := lo.Map(input.WorkspaceRoles, func(role iam.WorkspaceRole, _ int) string {
return role.WorkspaceId
})

// check if deploymentWorkspaceIds are in workspaceIds
workspaceIds = lo.Intersect(lo.Uniq(workspaceIds), lo.Uniq(deploymentWorkspaceIds))
workspaceIds = lo.Intersect(lo.Uniq(workspaceIds), deploymentWorkspaceIds)
if len(workspaceIds) != len(deploymentWorkspaceIds) {
tflog.Error(ctx, "failed to mutate roles")
return diag.Diagnostics{diag.NewErrorDiagnostic(
Expand Down

0 comments on commit 1aaaf46

Please sign in to comment.