Skip to content

Commit

Permalink
Remove plugin cache locking for Diff() (terraform plan)
Browse files Browse the repository at this point in the history
  • Loading branch information
toastwaffle committed Feb 1, 2024
1 parent f00f122 commit e7276c1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,8 @@ func (h Harness) Diff(ctx context.Context, o ...Option) (bool, error) {
cmd := exec.Command(h.Path, args...) //nolint:gosec
cmd.Dir = h.Dir

if h.UsePluginCache {
rwmutex.RLock()
defer rwmutex.RUnlock()
}
// Note: the rwmutex is intentionally not locked here to avoid excessive blocking. See
// https://github.com/upbound/provider-terraform/issues/239#issuecomment-1921732682

// The -detailed-exitcode flag will make terraform plan return:
// 0 - Succeeded, diff is empty (no changes)
Expand Down

0 comments on commit e7276c1

Please sign in to comment.