@@ -28,17 +28,19 @@ func TestEphemeralContainers(t *testing.T) {
2828 stdOut , stdErr , err = e2e .Zarf (t , "package" , "deploy" , path , "--confirm" )
2929 require .NoError (t , err , stdOut , stdErr )
3030
31+ t .Cleanup (func () {
32+ // cleanup
33+ stdOut , stdErr , err = e2e .Zarf (t , "package" , "remove" , "basic-pod" , "--confirm" )
34+ require .NoError (t , err , stdOut , stdErr )
35+ })
36+
3137 // using a pod the package deploys - run a kubectl debug command
32- stdOut , stdErr , err = e2e .Kubectl (t , "debug" , "test-pod" , "-n" , "test" , "--image=busybox:1.36" )
38+ stdOut , stdErr , err = e2e .Kubectl (t , "debug" , "test-pod" , "-n" , "test" , "--image=busybox:1.36" , "--profile" , "general" )
3339 require .NoError (t , err , stdOut , stdErr )
3440
3541 // get the pod and inspect the image used by the ephemeral container
3642 // it should have been mutated
3743 podStdOut , _ , err := e2e .Kubectl (t , "get" , "pod" , "test-pod" , "-n" , "test" , "-o" , "jsonpath={.status.ephemeralContainerStatuses[*].image}" )
3844 require .NoError (t , err )
39- require .Contains (t , podStdOut , "127.0.0.1:31337/library/busybox:1.36-zarf-" )
40-
41- // cleanup
42- stdOut , stdErr , err = e2e .Zarf (t , "package" , "remove" , "basic-pod" , "--confirm" )
43- require .NoError (t , err , stdOut , stdErr )
45+ require .Contains (t , podStdOut , "127.0.0.1:31999/library/busybox:1.36-zarf-" )
4446}
0 commit comments