Skip to content

Commit

Permalink
Merge pull request openshift#900 from abhinavdahiya/terraform_vendor
Browse files Browse the repository at this point in the history
destroy/bootstrap: explicit pass `disable-bootstrap.tfvars` for libvirt
  • Loading branch information
openshift-merge-robot committed Dec 13, 2018
2 parents 4a49712 + d19cad5 commit e431e60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/destroy/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package bootstrap

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
Expand All @@ -26,14 +27,14 @@ func Destroy(dir string) (err error) {
copyNames := []string{terraform.StateFileName, cluster.TfVarsFileName}

if platform == "libvirt" {
err = ioutil.WriteFile(filepath.Join(dir, "disable-bootstrap.auto.tfvars"), []byte(`{
err = ioutil.WriteFile(filepath.Join(dir, "disable-bootstrap.tfvars"), []byte(`{
"bootstrap_dns": false
}
`), 0666)
if err != nil {
return err
}
copyNames = append(copyNames, "disable-bootstrap.auto.tfvars")
copyNames = append(copyNames, "disable-bootstrap.tfvars")
}

tempDir, err := ioutil.TempDir("", "openshift-install-")
Expand All @@ -50,7 +51,7 @@ func Destroy(dir string) (err error) {
}

if platform == "libvirt" {
_, err = terraform.Apply(tempDir, platform)
_, err = terraform.Apply(tempDir, platform, fmt.Sprintf("-var-file=%s", filepath.Join(tempDir, "disable-bootstrap.tfvars")))
if err != nil {
return errors.Wrap(err, "Terraform apply")
}
Expand Down

0 comments on commit e431e60

Please sign in to comment.