@@ -18,7 +18,6 @@ package endpoints
1818
1919import (
2020 "net/http"
21- "os/exec"
2221 "testing"
2322
2423 "github.com/stretchr/testify/suite"
@@ -66,7 +65,7 @@ func (suite *EndpointsSuite) BeforeTest(suiteName, testName string) {
6665 case "Test_HTTP_Reach" :
6766 suite .client , err = e2e .NewHTTPClient (suite .tmplData .Host )
6867 suite .NoError (err )
69- suite .NoError (test .DeployYamlTemplate ("config/endpoints.yaml.tmpl" , test .GetNS (), suite .tmplData ))
68+ suite .NoError (test .Apply ("config/endpoints.yaml.tmpl" , test .GetNS (), suite .tmplData ))
7069 suite .Require ().Eventually (func () bool {
7170 res , cls , err := suite .client .Do ()
7271 if res == nil {
@@ -80,11 +79,10 @@ func (suite *EndpointsSuite) BeforeTest(suiteName, testName string) {
8079 suite .client , err = e2e .NewHTTPSClient ("tcp-service.test" , 32766 )
8180 suite .NoError (err )
8281 suite .tmplData .Replicas = 4
83- suite .NoError (test .DeployYamlTemplate ("config/endpoints.yaml.tmpl" , test .GetNS (), suite .tmplData ))
84- suite .NoError (test .DeployYaml ("config/tcp.yaml" , "haproxy-controller" ))
82+ suite .NoError (test .Apply ("config/endpoints.yaml.tmpl" , test .GetNS (), suite .tmplData ))
83+ suite .NoError (test .Apply ("config/tcp.yaml" , "" , nil ))
8584 test .AddTearDown (func () error {
86- cmd := exec .Command ("kubectl" , "-n" , "haproxy-controller" , "delete" , "cm" , "haproxy-configmap-tcp" )
87- return cmd .Run ()
85+ return suite .test .Delete ("config/tcp.yaml" )
8886 })
8987 suite .Require ().Eventually (func () bool {
9088 res , cls , err := suite .client .Do ()
0 commit comments