Close local Terraform state file when pushing to remote (#752)

## Changes
Close local Terraform state file when pushing to remote

Should help fix E2E test cleanup
```
testing.go:1225: TempDir RemoveAll cleanup: remove 
C:\Users\RUNNER~1\AppData\Local\Temp\TestAccPythonWheelTaskDeployAndRun1395546390\001\.databricks\bundle\default\terraform\terraform.tfstate: 
The process cannot access the file because it is being used by another process.
```
This commit is contained in:
Andrew Nester 2023-09-08 12:47:17 +02:00 committed by GitHub
parent e64463ba47
commit f7566b8264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -32,6 +32,7 @@ func (l *statePush) Apply(ctx context.Context, b *bundle.Bundle) error {
if err != nil {
return err
}
defer local.Close()
// Upload state file from local cache directory to filer.
log.Infof(ctx, "Writing local state file to remote state directory")