Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 6c39dcb

Browse files
committed
Use environment destroy
Signed-off-by: Mattias Gees <mattias.gees@gmail.com>
1 parent f3d7e9d commit 6c39dcb

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

cmd/tarmak/e2e/e2e_cluster_test.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func TestAWSSingleCluster(t *testing.T) {
2828
}
2929

3030
defer func() {
31-
t.Log("run cluster destroy command")
32-
c = ti.Command("cluster", "destroy")
31+
t.Log("run environment destroy command")
32+
c = ti.Command("environment", "destroy", "--name", ti.environmentName, "--auto-approve")
3333
// write error out to my stdout
3434
c.Stderr = os.Stderr
3535
if err := c.Run(); err != nil {
@@ -75,8 +75,8 @@ func TestAWSMultiCluster(t *testing.T) {
7575
}
7676

7777
defer func() {
78-
t.Log("run hub destroy command")
79-
c = ti.Command("--current-cluster", fmt.Sprintf("%s-hub", ti.environmentName), "cluster", "destroy")
78+
t.Log("run environment destroy command")
79+
c = ti.Command("environment", "destroy", "--name", ti.environmentName, "--auto-approve")
8080
// write error out to my stdout
8181
c.Stderr = os.Stderr
8282
if err := c.Run(); err != nil {
@@ -91,15 +91,6 @@ func TestAWSMultiCluster(t *testing.T) {
9191
t.Fatalf("unexpected error: %+v", err)
9292
}
9393

94-
defer func() {
95-
t.Log("run cluster destroy command")
96-
c = ti.Command("cluster", "destroy")
97-
// write error out to my stdout
98-
c.Stderr = os.Stderr
99-
if err := c.Run(); err != nil {
100-
t.Errorf("unexpected error: %+v", err)
101-
}
102-
}()
10394
t.Log("run cluster apply command")
10495
c = ti.Command("cluster", "apply")
10596
// write error out to my stdout

0 commit comments

Comments
 (0)