Merge pull request #10867 from rifelpet/kubetest-tf

kubetest2 - support terraform with `kops create cluster`
This commit is contained in:
Kubernetes Prow Robot 2021-02-18 02:42:51 -08:00 committed by GitHub
commit 66ad2895f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -118,6 +118,10 @@ func (d *deployer) createCluster(zones []string, adminAccess string) error {
args = appendIfUnset(args, "--master-size", "s-8vcpu-16gb")
}
if d.terraform != nil {
args = append(args, "--target", "terraform", "--out", d.terraform.Dir())
}
klog.Info(strings.Join(args, " "))
cmd := exec.Command(args[0], args[1:]...)
cmd.SetEnv(d.env()...)
@ -127,6 +131,13 @@ func (d *deployer) createCluster(zones []string, adminAccess string) error {
if err != nil {
return err
}
if d.terraform != nil {
if err := d.terraform.InitApply(); err != nil {
return err
}
}
return nil
}