Merge pull request #16102 from rifelpet/down-full

Don't get cluster --full when attempting leak cleanup
This commit is contained in:
Kubernetes Prow Robot 2023-11-14 12:14:37 +01:00 committed by GitHub
commit bf1189e212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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
}

View File

@ -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...)

View File

@ -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
}