mirror of https://github.com/kubernetes/kops.git
Merge pull request #16102 from rifelpet/down-full
Don't get cluster --full when attempting leak cleanup
This commit is contained in:
commit
bf1189e212
|
|
@ -33,7 +33,7 @@ func (d *deployer) Down() error {
|
|||
}
|
||||
|
||||
// There is no point running the rest of this function if the cluster doesn't exist
|
||||
cluster, _ := kops.GetCluster(d.KopsBinaryPath, d.ClusterName, nil)
|
||||
cluster, _ := kops.GetCluster(d.KopsBinaryPath, d.ClusterName, nil, false)
|
||||
if cluster == nil {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,12 @@ import (
|
|||
)
|
||||
|
||||
// GetCluster will retrieve the specified Cluster from the state store.
|
||||
func GetCluster(kopsBinary, clusterName string, env []string) (*api.Cluster, error) {
|
||||
func GetCluster(kopsBinary, clusterName string, env []string, full bool) (*api.Cluster, error) {
|
||||
args := []string{
|
||||
kopsBinary, "get", "cluster", clusterName, "-ojson", "--full",
|
||||
kopsBinary, "get", "cluster", clusterName, "-ojson",
|
||||
}
|
||||
if full {
|
||||
args = append(args, "--full")
|
||||
}
|
||||
c := exec.Command(args[0], args[1:]...)
|
||||
c.SetEnv(env...)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ func (t *Tester) getKopsCluster() (*api.Cluster, error) {
|
|||
|
||||
kopsClusterName := currentContext
|
||||
|
||||
cluster, err := kops.GetCluster("kops", kopsClusterName, nil)
|
||||
cluster, err := kops.GetCluster("kops", kopsClusterName, nil, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue