Skip to content

Commit

Permalink
fix!: incorrect logic around applyidempotant (#77)
Browse files Browse the repository at this point in the history
* fix: incorrect logic around applyidempotant

* chore: oh linting I love you

* test: update test
  • Loading branch information
matt-FFFFFF authored Feb 2, 2024
1 parent 8fa6c83 commit b85d48e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions setuptest/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func (resp Response) ApplyIdempotentRetry(r Retry) *testerror.Error {
case 0:
return "", nil
case 2:
return "", errors.New("terraform configuration not idempotent")
return "", retry.FatalError{Underlying: errors.New("terraform configuration not idempotent")}
default:
return "", retry.FatalError{Underlying: errors.New("terraform plan exit code 1 or other error")}
return "", errors.New("terraform plan error")
}
})

Expand Down
10 changes: 5 additions & 5 deletions setuptest/testdata/applyidempotentretryfail/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ terraform {
required_version = ">= 1.4.0"
required_providers {
local = {
source = "hashicorp/local"
source = "hashicorp/local"
version = ">= 2.4.0"
}
}
}

resource "local_file" "test" {
content = "test"
filename = "test.txt"
content = "test"
filename = "test.txt"
file_permission = "0644"
}

Expand All @@ -22,8 +22,8 @@ resource "terraform_data" "test" {

}
provisioner "local-exec" {
command = "rm -f test.txt"
when = create
command = "rm -rf .terraform"
when = create
}
depends_on = [
local_file.test,
Expand Down

0 comments on commit b85d48e

Please sign in to comment.