File tree Expand file tree Collapse file tree 2 files changed +2
-21
lines changed Expand file tree Collapse file tree 2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change 15
15
secretName: haproxy-offload-test
16
16
- hosts:
17
17
- default.haproxy
18
- secretName: haproxy-offload-test # Another cert to make sure HAProxy picks the right one
18
+ secretName: haproxy-default # Another cert to make sure HAProxy picks the right one
19
19
{{end}}
20
20
rules:
21
21
- host: {{ .Host }}
Original file line number Diff line number Diff line change 17
17
package https
18
18
19
19
import (
20
- "encoding/json"
21
- "io/ioutil"
22
-
23
20
"github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e"
24
21
)
25
22
26
23
func (suite * HTTPSSuite ) Test_HTTPS_Offload () {
27
24
var err error
28
25
suite .NoError (suite .test .DeployYamlTemplate ("config/ingress.yaml.tmpl" , suite .test .GetNS (), suite .tmplData ))
29
- suite .client , err = e2e .NewHTTPSClient (suite . tmplData . Host , 0 )
26
+ suite .client , err = e2e .NewHTTPSClient ("offload-test.haproxy" , 0 )
30
27
suite .NoError (err )
31
28
suite .Eventually (func () bool {
32
29
res , cls , err := suite .client .Do ()
@@ -35,22 +32,6 @@ func (suite *HTTPSSuite) Test_HTTPS_Offload() {
35
32
return false
36
33
}
37
34
defer cls ()
38
- body , err := ioutil .ReadAll (res .Body )
39
- if err != nil {
40
- return false
41
- }
42
- type echoServerResponse struct {
43
- OS struct {
44
- Hostname string `json:"hostname"`
45
- } `json:"os"`
46
- }
47
-
48
- response := & echoServerResponse {}
49
- err = json .Unmarshal (body , response )
50
- if err != nil {
51
- return false
52
- }
53
- //targetPod := strings.HasPrefix(response.OS.Hostname, "https-offload")
54
35
targetCrt := res .TLS .PeerCertificates [0 ].Subject .CommonName == "offload-test.haproxy"
55
36
return targetCrt
56
37
}, e2e .WaitDuration , e2e .TickDuration )
You can’t perform that action at this time.
0 commit comments