Merge pull request #11178 from rifelpet/kubetest2-flatcar

Kubetest2 - Add flag to expose cluster validation wait time
This commit is contained in:
Kubernetes Prow Robot 2021-04-05 23:59:34 -07:00 committed by GitHub
commit e42be5644e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -20,6 +20,7 @@ package deployer
import (
"flag"
"sync"
"time"
"github.com/octago/sflags/gen/gpflag"
"github.com/spf13/pflag"
@ -55,6 +56,8 @@ type deployer struct {
KopsBinaryPath string `flag:"kops-binary-path" desc:"The path to kops executable used for testing"`
StateStore string `flag:"-"`
ValidationWait time.Duration `flag:"validation-wait" desc:"time to wait for newly created cluster to pass validation"`
TemplatePath string `flag:"template-path" desc:"The path to the manifest template used for cluster creation"`
KubernetesVersion string `flag:"kubernetes-version" desc:"The kubernetes version to use in the cluster"`

View File

@ -147,17 +147,21 @@ func (d *deployer) createCluster(zones []string, adminAccess string) error {
}
func (d *deployer) IsUp() (bool, error) {
wait := "15m"
if d.TerraformVersion != "" {
// `--target terraform` doesn't precreate the API DNS records,
// so kops is more likely to hit negative TTLs during validation
wait = "20m"
wait := d.ValidationWait
if wait == 0 {
if d.TerraformVersion != "" {
// `--target terraform` doesn't precreate the API DNS records,
// so kops is more likely to hit negative TTLs during validation
wait = time.Duration(20) * time.Minute
} else {
wait = time.Duration(15) * time.Minute
}
}
args := []string{
d.KopsBinaryPath, "validate", "cluster",
"--name", d.ClusterName,
"--count", "10",
"--wait", wait,
"--wait", wait.String(),
}
klog.Info(strings.Join(args, " "))