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 1515 secretName: haproxy-offload-test
1616 - hosts:
1717 - 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
1919{{end}}
2020 rules:
2121 - host: {{ .Host }}
Original file line number Diff line number Diff line change 1717package https
1818
1919import (
20- "encoding/json"
21- "io/ioutil"
22-
2320 "github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e"
2421)
2522
2623func (suite * HTTPSSuite ) Test_HTTPS_Offload () {
2724 var err error
2825 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 )
3027 suite .NoError (err )
3128 suite .Eventually (func () bool {
3229 res , cls , err := suite .client .Do ()
@@ -35,22 +32,6 @@ func (suite *HTTPSSuite) Test_HTTPS_Offload() {
3532 return false
3633 }
3734 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")
5435 targetCrt := res .TLS .PeerCertificates [0 ].Subject .CommonName == "offload-test.haproxy"
5536 return targetCrt
5637 }, e2e .WaitDuration , e2e .TickDuration )
You can’t perform that action at this time.
0 commit comments