mirror of https://github.com/kubernetes/kops.git
test: Improve cluster deletion defaults
This commit is contained in:
parent
f3c9c05e82
commit
9bef6ef55a
|
@ -51,8 +51,9 @@ type DeleteClusterOptions struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *DeleteClusterOptions) InitDefaults() {
|
func (o *DeleteClusterOptions) InitDefaults() {
|
||||||
o.count = 42
|
o.count = 0
|
||||||
o.interval = 10 * time.Second
|
o.interval = 10 * time.Second
|
||||||
|
o.wait = 10 * time.Minute
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -24,13 +24,13 @@ kops delete cluster [CLUSTER] [flags]
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
--count int Number of consecutive failures to make progress deleting the cluster resources (default 42)
|
--count int Number of consecutive failures to make progress deleting the cluster resources
|
||||||
--external Delete an external cluster
|
--external Delete an external cluster
|
||||||
-h, --help help for cluster
|
-h, --help help for cluster
|
||||||
--interval duration Time in duration to wait between deletion attempts (default 10s)
|
--interval duration Time in duration to wait between deletion attempts (default 10s)
|
||||||
--region string External cluster's cloud region
|
--region string External cluster's cloud region
|
||||||
--unregister Don't delete cloud resources, just unregister the cluster
|
--unregister Don't delete cloud resources, just unregister the cluster
|
||||||
--wait duration Amount of time to wait for the cluster resources to de deleted
|
--wait duration Amount of time to wait for the cluster resources to de deleted (default 10m0s)
|
||||||
-y, --yes Specify --yes to delete the cluster
|
-y, --yes Specify --yes to delete the cluster
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,16 @@ func (d *deployer) Down() error {
|
||||||
d.KopsBinaryPath, "delete", "cluster",
|
d.KopsBinaryPath, "delete", "cluster",
|
||||||
"--name", d.ClusterName,
|
"--name", d.ClusterName,
|
||||||
"--yes",
|
"--yes",
|
||||||
"--count=0",
|
}
|
||||||
"--interval=60s",
|
version, err := kops.GetVersion(d.KopsBinaryPath)
|
||||||
"--wait=60m",
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if version > "1.29" {
|
||||||
|
args = append(args,
|
||||||
|
"--interval=60s",
|
||||||
|
"--wait=60m",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
klog.Info(strings.Join(args, " "))
|
klog.Info(strings.Join(args, " "))
|
||||||
cmd := exec.Command(args[0], args[1:]...)
|
cmd := exec.Command(args[0], args[1:]...)
|
||||||
|
|
Loading…
Reference in New Issue