Skip to content

Commit

Permalink
Merge pull request #16102 from rifelpet/down-full
Browse files Browse the repository at this point in the history
Don't get cluster --full when attempting leak cleanup
  • Loading branch information
k8s-ci-robot authored Nov 14, 2023
2 parents cef906f + b7befc1 commit bf1189e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/kubetest2-kops/deployer/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 5 additions & 2 deletions tests/e2e/pkg/kops/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/pkg/tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit bf1189e

Please sign in to comment.