Skip to content

Commit c97bcbb

Browse files
committed
fix lint
1 parent 8292585 commit c97bcbb

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

test/e2e/settings/ssl_passthrough.go

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
7878
ginkgo.Context("when handling traffic", func() {
7979
var tlsConfig *tls.Config
8080
host := "testpassthrough.com"
81+
url := "https://" + net.JoinHostPort(host, "443")
8182
echoName := "echopass"
8283
secretName := host
8384

@@ -153,6 +154,7 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
153154
ginkgo.It("should pass unknown traffic to default backend and handle known traffic", func() {
154155
/* This one should not receive traffic as it does not contain passthrough annotation */
155156
hostBad := "noannotationnopassthrough.com"
157+
urlBad := "https://" + net.JoinHostPort(hostBad, "443")
156158
ingBad := f.EnsureIngress(framework.NewSingleIngressWithTLS(hostBad,
157159
"/",
158160
hostBad,
@@ -173,34 +175,30 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
173175
return strings.Contains(server, "listen 442")
174176
})
175177

176-
//nolint:gosec // Ignore the gosec error in testing
177178
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
178179
GET("/").
179-
WithURL("https://"+net.JoinHostPort(host, "443")).
180+
WithURL(url).
180181
ForceResolve(f.GetNginxIP(), 443).
181182
Expect().
182183
Status(http.StatusOK)
183184

184-
//nolint:gosec // Ignore the gosec error in testing
185185
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: hostBad, InsecureSkipVerify: true}).
186186
GET("/").
187-
WithURL("https://"+net.JoinHostPort(hostBad, "443")).
187+
WithURL(urlBad).
188188
ForceResolve(f.GetNginxIP(), 443).
189189
Expect().
190190
Status(http.StatusNotFound)
191191

192-
//nolint:gosec // Ignore the gosec error in testing
193192
f.HTTPTestClientWithTLSConfig(tlsConfig).
194193
GET("/").
195-
WithURL("https://"+net.JoinHostPort(host, "443")).
194+
WithURL(url).
196195
ForceResolve(f.GetNginxIP(), 443).
197196
Expect().
198197
Status(http.StatusOK)
199198

200-
//nolint:gosec // Ignore the gosec error in testing
201199
f.HTTPTestClientWithTLSConfig(tlsConfigBad).
202200
GET("/").
203-
WithURL("https://"+net.JoinHostPort(hostBad, "443")).
201+
WithURL(urlBad).
204202
ForceResolve(f.GetNginxIP(), 443).
205203
Expect().
206204
Status(http.StatusNotFound)
@@ -222,10 +220,9 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
222220

223221
ginkgo.It("should handle known traffic without Host header", func() {
224222
for i := 0; i < tries; i++ {
225-
//nolint:gosec // Ignore the gosec error in testing
226223
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
227224
GET("/").
228-
WithURL("https://"+net.JoinHostPort(host, "443")).
225+
WithURL(url).
229226
ForceResolve(f.GetNginxIP(), 443).
230227
WithDialContextMiddleware(throttleMiddleware).
231228
Expect().
@@ -235,10 +232,9 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
235232

236233
ginkgo.It("should handle known traffic with Host header", func() {
237234
for i := 0; i < tries; i++ {
238-
//nolint:gosec // Ignore the gosec error in testing
239235
f.HTTPTestClientWithTLSConfig(tlsConfig).
240236
GET("/").
241-
WithURL("https://"+net.JoinHostPort(host, "443")).
237+
WithURL(url).
242238
WithHeader("Host", host).
243239
ForceResolve(f.GetNginxIP(), 443).
244240
WithDialContextMiddleware(throttleMiddleware).
@@ -249,10 +245,9 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
249245

250246
ginkgo.It("should handle insecure traffic with Host header", func() {
251247
for i := 0; i < tries; i++ {
252-
//nolint:gosec // Ignore the gosec error in testing
253248
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
254249
GET("/").
255-
WithURL("https://"+net.JoinHostPort(host, "443")).
250+
WithURL(url).
256251
WithHeader("Host", host).
257252
ForceResolve(f.GetNginxIP(), 443).
258253
WithDialContextMiddleware(throttleMiddleware).

0 commit comments

Comments
 (0)