mirror of https://github.com/kubernetes/kops.git
Kubetest2 - Add flag to expose cluster validation wait time
The flatcar jobs are failing because the OS performs package updates and a reboot after initial launch, even with the latest AMI. This causes the cluster to timeout on its validation. Exposing a flag will allow us to conditionally extend the validation for the flatcar tests
This commit is contained in:
parent
b03b50fdb1
commit
ba4c6fadcb
|
|
@ -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"`
|
||||
|
|
|
|||
|
|
@ -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, " "))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue