@@ -3,15 +3,13 @@ package terminal
33import (
44 "bytes"
55 "context"
6- "fmt"
76 "github.com/loft-sh/devspace/cmd"
87 "github.com/loft-sh/devspace/cmd/flags"
98 "github.com/loft-sh/devspace/e2e/framework"
109 "github.com/loft-sh/devspace/e2e/kube"
1110 "github.com/loft-sh/devspace/pkg/devspace/devpod"
1211 "github.com/loft-sh/devspace/pkg/util/factory"
1312 "github.com/onsi/ginkgo"
14- "io/ioutil"
1513 kerrors "k8s.io/apimachinery/pkg/api/errors"
1614 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1715 "k8s.io/apimachinery/pkg/util/wait"
@@ -78,7 +76,6 @@ var _ = DevSpaceDescribe("terminal", func() {
7876 // wait until we get the first hostnames
7977 var podName string
8078 err = wait .PollImmediate (time .Second , time .Minute * 3 , func () (done bool , err error ) {
81- fmt .Println (buffer .String ())
8279 lines := strings .Split (buffer .String (), "\n " )
8380 if len (lines ) <= 1 {
8481 return false , nil
@@ -90,16 +87,7 @@ var _ = DevSpaceDescribe("terminal", func() {
9087 framework .ExpectNoError (err )
9188
9289 // make sure the pod exists
93- pod , err := kubeClient .RawClient ().CoreV1 ().Pods (ns ).Get (context .TODO (), podName , metav1.GetOptions {})
94- framework .ExpectNoError (err )
95- framework .ExpectEqual (pod .Spec .Containers [0 ].Image , "ubuntu:18.04" )
96-
97- // now make a change to the config
98- fileContents , err := ioutil .ReadFile ("devspace.yaml" )
99- framework .ExpectNoError (err )
100- newString := strings .Replace (string (fileContents ), "ubuntu:18.04" , "alpine:3.14" , - 1 )
101- newString = strings .Replace (newString , "container-0" , "container-1" , - 1 )
102- err = ioutil .WriteFile ("devspace.yaml" , []byte (newString ), 0666 )
90+ err = kubeClient .RawClient ().CoreV1 ().Pods (ns ).Delete (context .TODO (), podName , metav1.DeleteOptions {})
10391 framework .ExpectNoError (err )
10492
10593 // wait until pod is terminated
@@ -135,10 +123,8 @@ var _ = DevSpaceDescribe("terminal", func() {
135123 framework .ExpectNoError (err )
136124
137125 // make sure the pod exists
138- pod , err = kubeClient .RawClient ().CoreV1 ().Pods (ns ).Get (context .TODO (), podName , metav1.GetOptions {})
126+ _ , err = kubeClient .RawClient ().CoreV1 ().Pods (ns ).Get (context .TODO (), podName , metav1.GetOptions {})
139127 framework .ExpectNoError (err )
140- framework .ExpectEqual (pod .Spec .Containers [0 ].Image , "alpine:3.14" )
141- framework .ExpectEqual (pod .Spec .Containers [0 ].Name , "container-1" )
142128
143129 // make sure command terminates correctly
144130 cancel ()
0 commit comments