Skip to content

Commit

Permalink
go proxy integration test: remove unused flags from the test
Browse files Browse the repository at this point in the history
- The flags are not being used in the test
- The flags are being parsed inside a goroutine which
  is causing a panic (due to race condition)
  • Loading branch information
vyasgun authored and anjannath committed Oct 4, 2024
1 parent 28c34fa commit 053da06
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/extended/util/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"crypto/tls"
"crypto/x509"
_ "embed" // blanks are good
"flag"
"fmt"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -70,12 +70,11 @@ func RunProxy() {
ipaddr = "192.168.130.1"
}

verbose := flag.Bool("v", true, "should every proxy request be logged to stdout")
addr := flag.String(ipaddr, ":8888", "proxy listen address") // using network-mode=user
flag.Parse()
proxy.Verbose = *verbose
addr := fmt.Sprintf("%s:8888", ipaddr)
proxy.Verbose = true
proxy.Logger = log.StandardLogger()
err = http.ListenAndServe(*addr, proxy) // #nosec G114

err = http.ListenAndServe(addr, proxy) // #nosec G114
if err != nil {
log.Printf("error running proxy: %s", err)
}
Expand Down

0 comments on commit 053da06

Please sign in to comment.