Skip to content

Commit 14110c5

Browse files
committed
TEST: e2e: merge DeployYamlTemplate and DeployYalm methods into
Apply
1 parent a88d703 commit 14110c5

31 files changed

+91
-85
lines changed

deploy/tests/e2e/basic-auth/basic_auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
func (suite *HTTPBasicAuthSuite) Test_BasicAuth() {
2626
suite.Run("Denied", func() {
27-
suite.NoError(suite.test.DeployYamlTemplate("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
27+
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
2828
suite.Require().Eventually(func() bool {
2929
res, cls, err := suite.client.Do()
3030
if res == nil {

deploy/tests/e2e/canary-deployment/percentage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (suite *CanaryDeploymentSuite) Test_Response_Percentage() {
2828
for _, percentage := range []int{0, 25, 100} {
2929
suite.Run(fmt.Sprintf("%d", percentage), func() {
3030
suite.tmplData.StagingRouteACL = fmt.Sprintf("rand(100) lt %d", percentage)
31-
suite.NoError(suite.test.DeployYamlTemplate("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
31+
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
3232
suite.Eventually(func() bool {
3333
counter := 0
3434
for i := 0; i < 10; i++ {

deploy/tests/e2e/canary-deployment/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (suite *CanaryDeploymentSuite) SetupSuite() {
4848
}
4949
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
5050
suite.NoError(err)
51-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
51+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
5252
suite.Require().Eventually(func() bool {
5353
res, cls, err := suite.client.Do()
5454
if res == nil {

deploy/tests/e2e/config-snippet/backend_cfg_snippet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func (suite *ConfigSnippetSuite) TestBackendCfgSnippet() {
27-
suite.NoError(suite.test.DeployYaml("config/backend-cfg-snippet.yaml", suite.test.GetNS()))
27+
suite.NoError(suite.test.Apply("config/backend-cfg-snippet.yaml", suite.test.GetNS(), nil))
2828
suite.Eventually(func() bool {
2929
res, cls, err := suite.client.Do()
3030
if err != nil {

deploy/tests/e2e/config-snippet/frontend_cfg_snippet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func (suite *ConfigSnippetSuite) TestFrontendCfgSnippet() {
27-
suite.NoError(suite.test.DeployYaml("config/configmap.yaml", "haproxy-controller"))
27+
suite.NoError(suite.test.Apply("config/configmap.yaml", "", nil))
2828
suite.Eventually(func() bool {
2929
res, cls, err := suite.client.Do()
3030
if err != nil {

deploy/tests/e2e/config-snippet/suite_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package configsnippet
1818

1919
import (
20-
"os/exec"
2120
"testing"
2221

2322
"github.com/stretchr/testify/suite"
@@ -43,7 +42,7 @@ func (suite *ConfigSnippetSuite) SetupSuite() {
4342
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4443
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
4544
suite.NoError(err)
46-
suite.NoError(suite.test.DeployYamlTemplate("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
45+
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
4746
suite.Require().Eventually(func() bool {
4847
res, cls, err := suite.client.Do()
4948
if res == nil {
@@ -54,8 +53,7 @@ func (suite *ConfigSnippetSuite) SetupSuite() {
5453
return res.StatusCode == 200
5554
}, e2e.WaitDuration, e2e.TickDuration)
5655
suite.test.AddTearDown(func() error {
57-
cmd := exec.Command("kubectl", "apply", "-f", "../../config/3.configmap.yaml")
58-
return cmd.Run()
56+
return suite.test.Apply("../../config/3.configmap.yaml", "", nil)
5957
})
6058
}
6159

deploy/tests/e2e/endpoints/http_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (suite *EndpointsSuite) Test_HTTP_Reach() {
3131
for _, replicas := range []int{4, 8, 2, 0, 3} {
3232
suite.Run(fmt.Sprintf("%d-replicas", replicas), func() {
3333
suite.tmplData.Replicas = replicas
34-
suite.NoError(suite.test.DeployYamlTemplate("config/endpoints.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
34+
suite.NoError(suite.test.Apply("config/endpoints.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
3535
suite.Eventually(func() bool {
3636
counter := map[string]int{}
3737
for i := 0; i < replicas*2; i++ {

deploy/tests/e2e/endpoints/suite_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package endpoints
1818

1919
import (
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()

deploy/tests/e2e/global-config/maxconn_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,15 @@
1717
package globalconfig
1818

1919
import (
20-
"os/exec"
21-
2220
"github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e"
2321
)
2422

2523
func (suite *GlobalConfigSuite) TestMaxconn() {
26-
cmd := exec.Command("kubectl", "apply", "-f", "config/configmap.yaml")
27-
_, err := cmd.CombinedOutput()
28-
suite.Require().NoError(err)
24+
suite.NoError(suite.test.Apply("config/configmap.yaml", "", nil))
2925
suite.maxconn = "1111"
3026
suite.Eventually(suite.checkMaxconn, e2e.WaitDuration, e2e.TickDuration)
3127

32-
cmd = exec.Command("kubectl", "apply", "-f", "../../config/3.configmap.yaml")
33-
_, err = cmd.CombinedOutput()
34-
suite.Require().NoError(err)
28+
suite.NoError(suite.test.Apply("../../config/3.configmap.yaml", "", nil))
3529
suite.maxconn = "1000"
3630
suite.Eventually(suite.checkMaxconn, e2e.WaitDuration, e2e.TickDuration)
3731
}

deploy/tests/e2e/global-config/suite_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,22 @@ import (
2020
"testing"
2121

2222
"github.com/stretchr/testify/suite"
23+
24+
"github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e"
2325
)
2426

2527
type GlobalConfigSuite struct {
2628
suite.Suite
29+
test e2e.Test
2730
maxconn string
2831
}
2932

33+
func (suite *GlobalConfigSuite) SetupSuite() {
34+
var err error
35+
suite.test, err = e2e.NewTest()
36+
suite.NoError(err)
37+
}
38+
3039
func TestGlobalConfigSuite(t *testing.T) {
3140
suite.Run(t, new(GlobalConfigSuite))
3241
}

deploy/tests/e2e/https/offload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
func (suite *HTTPSSuite) Test_HTTPS_Offload() {
2424
var err error
25-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
25+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
2626
suite.client, err = e2e.NewHTTPSClient("offload-test.haproxy", 0)
2727
suite.NoError(err)
2828
suite.Eventually(func() bool {

deploy/tests/e2e/https/passthrough.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Passthrough() {
2828
suite.tmplData.IngAnnotations = []struct{ Key, Value string }{
2929
{"ssl-passthrough", "'true'"},
3030
}
31-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
31+
suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
3232
suite.Run("Reach_Backend", func() {
3333
suite.Eventually(func() bool {
3434
res, cls, err := suite.client.Do()
@@ -59,7 +59,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Passthrough() {
5959
{"ssl-passthrough", "'true'"},
6060
{"whitelist", "6.6.6.6"},
6161
}
62-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
62+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
6363
suite.Eventually(func() bool {
6464
res, cls, err := suite.client.Do()
6565
if err == nil {

deploy/tests/e2e/https/redirect.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
)
2222

2323
func (suite *HTTPSSuite) Test_HTTPS_Redirect() {
24-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
24+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
2525
suite.Require().Eventually(func() bool {
2626
res, cls, err := suite.client.Do()
2727
if res == nil {
@@ -34,7 +34,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Redirect() {
3434
suite.Run("implicit_via_TLS", func() {
3535
suite.tmplData.TLSEnabled = true
3636
suite.Eventually(func() bool {
37-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
37+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
3838
res, cls, err := suite.client.Do()
3939
if res == nil {
4040
suite.T().Log(err)
@@ -50,7 +50,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Redirect() {
5050
{"ssl-redirect", "'true'"},
5151
{"ssl-redirect-code", "'301'"},
5252
}
53-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
53+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
5454
suite.Eventually(func() bool {
5555
res, cls, err := suite.client.Do()
5656
if res == nil {
@@ -66,7 +66,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Redirect() {
6666
suite.tmplData.IngAnnotations = []struct{ Key, Value string }{
6767
{"ssl-redirect", "'false'"},
6868
}
69-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
69+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
7070
suite.Eventually(func() bool {
7171
res, cls, err := suite.client.Do()
7272
if res == nil {

deploy/tests/e2e/https/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (suite *HTTPSSuite) SetupSuite() {
5959
suite.test, err = e2e.NewTest()
6060
suite.NoError(err)
6161
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
62-
suite.NoError(suite.test.DeployYaml("config/deploy.yaml", suite.test.GetNS()))
62+
suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil))
6363
}
6464

6565
func (suite *HTTPSSuite) TearDownSuite() {

deploy/tests/e2e/ingress-match/ingress_match_path_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ func (suite *IngressMatchSuite) Test_Http_MatchPath() {
7373
suite.tmplData.Apps[i] = i + 1
7474
}
7575
suite.tmplData.Rules = ingressRules
76-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
77-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
76+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
77+
suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
7878

7979
for _, test := range tests {
8080
for _, path := range test.paths {

deploy/tests/e2e/ingressclass/config/deploy.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,3 @@ spec:
4040
targetPort: https
4141
selector:
4242
app: http-echo
43-
---
44-
apiVersion: networking.k8s.io/v1beta1
45-
kind: IngressClass
46-
metadata:
47-
name: haproxy
48-
spec:
49-
controller: haproxy.org/ingress-controller/haproxy
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
apiVersion: networking.k8s.io/v1beta1
3+
kind: IngressClass
4+
metadata:
5+
name: haproxy
6+
spec:
7+
controller: haproxy.org/ingress-controller/haproxy

deploy/tests/e2e/ingressclass/ingressClass_test.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ package ingressclass
1818

1919
import (
2020
"net/http"
21-
"os/exec"
2221

2322
"github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e"
2423
)
2524

2625
func (suite *IngressClassSuite) Test_IngressClassName_Field() {
2726
test := suite.test
2827
suite.Run("Disabled", func() {
29-
suite.NoError(test.DeployYamlTemplate("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData))
28+
suite.NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData))
3029
suite.Eventually(func() bool {
3130
res, cls, err := suite.client.Do()
3231
if err != nil {
@@ -40,7 +39,7 @@ func (suite *IngressClassSuite) Test_IngressClassName_Field() {
4039

4140
suite.Run("Enabled", func() {
4241
suite.tmplData.IngressClassName = "haproxy"
43-
suite.NoError(test.DeployYamlTemplate("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData))
42+
suite.NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData))
4443
suite.Eventually(func() bool {
4544
res, cls, err := suite.client.Do()
4645
if err != nil {
@@ -56,9 +55,7 @@ func (suite *IngressClassSuite) Test_IngressClassName_Field() {
5655
func (suite *IngressClassSuite) Test_IngressClassName_Resource() {
5756
test := suite.test
5857
suite.Run("Disabled", func() {
59-
cmd := exec.Command("kubectl", "delete", "ingressclasses", "haproxy")
60-
suite.NoError(cmd.Run())
61-
58+
suite.NoError(test.Delete("config/ingressclass.yaml"))
6259
suite.Eventually(func() bool {
6360
res, cls, err := suite.client.Do()
6461
if err != nil {
@@ -71,7 +68,7 @@ func (suite *IngressClassSuite) Test_IngressClassName_Resource() {
7168
})
7269

7370
suite.Run("Enabled", func() {
74-
suite.NoError(test.DeployYaml("config/deploy.yaml", test.GetNS()))
71+
suite.NoError(suite.test.Apply("config/ingressclass.yaml", "", nil))
7572
suite.Eventually(func() bool {
7673
res, cls, err := suite.client.Do()
7774
if err != nil {

deploy/tests/e2e/ingressclass/suite_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package ingressclass
1818

1919
import (
20-
"os/exec"
2120
"testing"
2221

2322
"github.com/stretchr/testify/suite"
@@ -49,10 +48,10 @@ func (suite *IngressClassSuite) SetupSuite() {
4948
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
5049
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
5150
suite.NoError(err)
52-
suite.NoError(suite.test.DeployYaml("config/deploy.yaml", suite.test.GetNS()))
51+
suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil))
52+
suite.NoError(suite.test.Apply("config/ingressclass.yaml", "", nil))
5353
suite.test.AddTearDown(func() error {
54-
cmd := exec.Command("kubectl", "delete", "ingressclasses", "haproxy")
55-
return cmd.Run()
54+
return suite.test.Delete("config/ingressclass.yaml")
5655
})
5756
}
5857

deploy/tests/e2e/proxy-protocol/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (suite *ProxyProtocolSuite) SetupSuite() {
4242
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4343
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
4444
suite.NoError(err)
45-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
45+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
4646
}
4747

4848
func (suite *ProxyProtocolSuite) TearDownSuite() {

deploy/tests/e2e/rate-limiting/http_rate_limiting_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (suite *RateLimitingSuite) Test_Rate_Limiting() {
4040
{"rate-limit-requests", fmt.Sprintf("%d", tc.limitRequests)},
4141
{"rate-limit-status-code", fmt.Sprintf("%d", tc.customStatusCode)},
4242
}
43-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
43+
suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
4444
suite.Require().Eventually(func() bool {
4545
var counter, responseCode int
4646
suite.client.Host = suite.tmplData.Host

deploy/tests/e2e/rate-limiting/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func (suite *RateLimitingSuite) SetupSuite() {
4343
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4444
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
4545
suite.NoError(err)
46-
suite.NoError(suite.test.DeployYaml("config/deploy.yaml", suite.test.GetNS()))
47-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
46+
suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil))
47+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
4848
suite.Require().Eventually(func() bool {
4949
r, cls, err := suite.client.Do()
5050
if err != nil {

deploy/tests/e2e/service-discovery/port_discovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (suite *ServiceDiscoverySuite) Test_Port_Discovery() {
3535
func (suite *ServiceDiscoverySuite) testServicePort(serviceName, servicePort string) {
3636
suite.tmplData.ServiceName = serviceName
3737
suite.tmplData.ServicePort = servicePort
38-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
38+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
3939
suite.Eventually(func() bool {
4040
res, cls, err := suite.client.Do()
4141
if res == nil {

deploy/tests/e2e/service-discovery/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ func (suite *ServiceDiscoverySuite) SetupSuite() {
4949
}
5050
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
5151
suite.NoError(err)
52-
suite.NoError(suite.test.DeployYaml("config/deploy.yaml", suite.test.GetNS()))
53-
suite.NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
52+
suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil))
53+
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
5454
suite.Require().Eventually(func() bool {
5555
res, cls, err := suite.client.Do()
5656
if res == nil {

deploy/tests/e2e/set-header/set_header_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (suite *SetHeaderSuite) Test_Request_Set_Header() {
3636
suite.tmplData.IngAnnotations = []struct{ Key, Value string }{
3737
{"request-set-header", tc.headerName + " " + tc.headerValue},
3838
}
39-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
39+
suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
4040
suite.Eventually(func() bool {
4141
res, cls, err := suite.client.Do()
4242
if err != nil {
@@ -73,7 +73,7 @@ func (suite *SetHeaderSuite) Test_Response_Set_Header() {
7373
suite.tmplData.IngAnnotations = []struct{ Key, Value string }{
7474
{"response-set-header", tc.headerName + " " + tc.headerValue},
7575
}
76-
suite.Require().NoError(suite.test.DeployYamlTemplate("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
76+
suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
7777
suite.Eventually(func() bool {
7878
r, cls, err := suite.client.Do()
7979
if err != nil {

0 commit comments

Comments
 (0)