Skip to content

Commit e7b2f51

Browse files
Merge pull request openshift#7671 from patrickdillon/ocpbugs-22772-tfstate
OCPBUGS-22772: return Terraform statefile on error
2 parents 9ff8208 + 21fd606 commit e7b2f51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/terraform/terraform.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ func applyTerraform(tmpDir string, platform string, stage Stage, terraformDir st
280280
}
281281

282282
if applyErr != nil {
283-
return nil, nil, fmt.Errorf("error applying Terraform configs: %w", applyErr)
283+
return nil, stateFile, fmt.Errorf("error applying Terraform configs: %w", applyErr)
284284
}
285285

286286
outputs, err := Outputs(tmpDir, terraformDir)
287287
if err != nil {
288-
return nil, nil, errors.Wrapf(err, "could not get outputs from stage %q", stage.Name())
288+
return nil, stateFile, errors.Wrapf(err, "could not get outputs from stage %q", stage.Name())
289289
}
290290

291291
outputsFile = &asset.File{

0 commit comments

Comments
 (0)