From f22e901f467ce93d590aa050d975999eec7055f0 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 20 Mar 2024 10:20:48 +0100 Subject: [PATCH] build: Update gvisor-tap-vsock go module Better to have https://github.com/containers/gvisor-tap-vsock/pull/338 in as otherwise `inet.af/tcpproxy` is an indirect crc dependency, and this module is no longer available. Signed-off-by: Christophe Fergeau --- go.mod | 4 ++-- go.sum | 8 ++++---- .../gvisor-tap-vsock/pkg/services/dhcp/dhcp.go | 2 +- .../gvisor-tap-vsock/pkg/services/dns/dns.go | 2 +- .../pkg/services/forwarder/ports.go | 10 +++++----- .../gvisor-tap-vsock/pkg/services/forwarder/tcp.go | 4 ++-- .../gvisor-tap-vsock/pkg/sshclient/bastion.go | 2 +- .../gvisor-tap-vsock/pkg/transport/dial_darwin.go | 2 +- .../gvisor-tap-vsock/pkg/virtualnetwork/mux.go | 14 +++++++------- .../inetaf}/tcpproxy/.travis.yml | 0 .../inetaf}/tcpproxy/CONTRIBUTING.md | 0 .../inetaf}/tcpproxy/LICENSE | 0 .../inetaf}/tcpproxy/README.md | 2 +- .../inetaf}/tcpproxy/http.go | 0 .../inetaf}/tcpproxy/listener.go | 0 .../{inet.af => github.com/inetaf}/tcpproxy/sni.go | 0 .../inetaf}/tcpproxy/tcpproxy.go | 0 vendor/modules.txt | 8 ++++---- 18 files changed, 29 insertions(+), 29 deletions(-) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/.travis.yml (100%) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/CONTRIBUTING.md (100%) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/LICENSE (100%) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/README.md (59%) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/http.go (100%) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/listener.go (100%) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/sni.go (100%) rename vendor/{inet.af => github.com/inetaf}/tcpproxy/tcpproxy.go (100%) diff --git a/go.mod b/go.mod index 135edd756f..8d73a3cf97 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 github.com/cavaliergopher/grab/v3 v3.0.1 github.com/cheggaaa/pb/v3 v3.1.5 - github.com/containers/gvisor-tap-vsock v0.7.3 + github.com/containers/gvisor-tap-vsock v0.7.4-0.20240320091526-a0238e52b61f github.com/containers/image/v5 v5.30.0 github.com/coreos/go-systemd/v22 v22.5.0 github.com/crc-org/admin-helper v0.5.2 @@ -129,6 +129,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/inetaf/tcpproxy v0.0.0-20240214030015-3ce58045626c // indirect github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -200,7 +201,6 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gvisor.dev/gvisor v0.0.0-20231023213702-2691a8f9b1cf // indirect - inet.af/tcpproxy v0.0.0-20231102063150-2862066fc2a9 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect diff --git a/go.sum b/go.sum index dd7dbb27d2..81284628d4 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/cheggaaa/pb/v3 v3.1.5/go.mod h1:CrxkeghYTXi1lQBEI7jSn+3svI3cuc19haAj6 github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= -github.com/containers/gvisor-tap-vsock v0.7.3 h1:yORnf15sP+sLFhxLNLgmB5/lOhldn9dRMHx/tmYtSOQ= -github.com/containers/gvisor-tap-vsock v0.7.3/go.mod h1:NI1fLMtKXQZoDrrOeqryGz7x7j/XSFWRmQILva7Fu9c= +github.com/containers/gvisor-tap-vsock v0.7.4-0.20240320091526-a0238e52b61f h1:NOq4UwN3M4rvN44CPznCqQlOvim7Ja1RZ082ORAJjVQ= +github.com/containers/gvisor-tap-vsock v0.7.4-0.20240320091526-a0238e52b61f/go.mod h1:hZrvqbYhTIUQCREov+M8u7sMhzGbB6umiDuVpnwtJcI= github.com/containers/image/v5 v5.30.0 h1:CmHeSwI6W2kTRWnUsxATDFY5TEX4b58gPkaQcEyrLIA= github.com/containers/image/v5 v5.30.0/go.mod h1:gSD8MVOyqBspc0ynLsuiMR9qmt8UQ4jpVImjmK0uXfk= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA= @@ -263,6 +263,8 @@ github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inetaf/tcpproxy v0.0.0-20240214030015-3ce58045626c h1:gYfYE403/nlrGNYj6BEOs9ucLCAGB9gstlSk92DttTg= +github.com/inetaf/tcpproxy v0.0.0-20240214030015-3ce58045626c/go.mod h1:Di7LXRyUcnvAcLicFhtM9/MlZl/TNgRSDHORM2c6CMI= github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f h1:l1QCwn715k8nYkj4Ql50rzEog3WnMdrd4YYMMwemxEo= github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f/go.mod h1:h+MxyHxRg9NH3terB1nfRIUaQEcI0XOVkdR9LNBlp8E= github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= @@ -709,8 +711,6 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gvisor.dev/gvisor v0.0.0-20231023213702-2691a8f9b1cf h1:0A28IFBR6VcMacM0m6Rn5/nr8pk8xa2TyIkjSaFAOPc= gvisor.dev/gvisor v0.0.0-20231023213702-2691a8f9b1cf/go.mod h1:8hmigyCdYtw5xJGfQDJzSH5Ju8XEIDBnpyi8+O6GRt8= -inet.af/tcpproxy v0.0.0-20231102063150-2862066fc2a9 h1:zomTWJvjwLbKRgGameQtpK6DNFUbZ2oNJuWhgUkGp3M= -inet.af/tcpproxy v0.0.0-20231102063150-2862066fc2a9/go.mod h1:Tojt5kmHpDIR2jMojxzZK2w2ZR7OILODmUo2gaSwjrk= k8s.io/api v0.28.8 h1:G0/G7yX1puRAcon/+XPLsKXZ9A5L7Ds6oKbDIe027xw= k8s.io/api v0.28.8/go.mod h1:rU8f1t9CNUAXlk/1j/wMJ7XnaxkR1g1AlZGQAOOL+sw= k8s.io/apimachinery v0.28.8 h1:hi/nrxHwk4QLV+W/SHve1bypTE59HCDorLY1stBIxKQ= diff --git a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dhcp/dhcp.go b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dhcp/dhcp.go index f464a31d6f..cfd5370ea8 100644 --- a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dhcp/dhcp.go +++ b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dhcp/dhcp.go @@ -120,7 +120,7 @@ func (s *Server) Serve() error { func (s *Server) Mux() http.Handler { mux := http.NewServeMux() - mux.HandleFunc("/leases", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/leases", func(w http.ResponseWriter, _ *http.Request) { _ = json.NewEncoder(w).Encode(s.IPPool.Leases()) }) return mux diff --git a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dns/dns.go b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dns/dns.go index 15ed72f1df..1cfe0b6cb3 100644 --- a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dns/dns.go +++ b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/dns/dns.go @@ -231,7 +231,7 @@ func (s *Server) ServeTCP() error { func (s *Server) Mux() http.Handler { mux := http.NewServeMux() - mux.HandleFunc("/all", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/all", func(w http.ResponseWriter, _ *http.Request) { s.handler.zonesLock.RLock() _ = json.NewEncoder(w).Encode(s.handler.zones) s.handler.zonesLock.RUnlock() diff --git a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/ports.go b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/ports.go index 828c248b5b..7d6c06c2d2 100644 --- a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/ports.go +++ b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/ports.go @@ -17,12 +17,12 @@ import ( "github.com/containers/gvisor-tap-vsock/pkg/sshclient" "github.com/containers/gvisor-tap-vsock/pkg/types" + "github.com/inetaf/tcpproxy" log "github.com/sirupsen/logrus" "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/adapters/gonet" "gvisor.dev/gvisor/pkg/tcpip/network/ipv4" "gvisor.dev/gvisor/pkg/tcpip/stack" - "inet.af/tcpproxy" ) type PortsForwarder struct { @@ -117,7 +117,7 @@ func (f *PortsForwarder) Expose(protocol types.TransportProtocol, local, remote var sshForward *sshclient.SSHForward var connLock sync.Mutex - dialFn = func(ctx context.Context, network, addr string) (net.Conn, error) { + dialFn = func(ctx context.Context, _, _ string) (net.Conn, error) { connLock.Lock() defer connLock.Unlock() @@ -145,7 +145,7 @@ func (f *PortsForwarder) Expose(protocol types.TransportProtocol, local, remote return err } - dialFn = func(ctx context.Context, network, addr string) (conn net.Conn, e error) { + dialFn = func(ctx context.Context, _, _ string) (conn net.Conn, e error) { return gonet.DialContextTCP(ctx, f.stack, address, ipv4.ProtocolNumber) } @@ -232,7 +232,7 @@ func (f *PortsForwarder) Expose(protocol types.TransportProtocol, local, remote var p tcpproxy.Proxy p.AddRoute(local, &tcpproxy.DialProxy{ Addr: remote, - DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, e error) { + DialContext: func(ctx context.Context, _, _ string) (conn net.Conn, e error) { return gonet.DialContextTCP(ctx, f.stack, address, ipv4.ProtocolNumber) }, }) @@ -273,7 +273,7 @@ func (f *PortsForwarder) Unexpose(protocol types.TransportProtocol, local string func (f *PortsForwarder) Mux() http.Handler { mux := http.NewServeMux() - mux.HandleFunc("/all", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/all", func(w http.ResponseWriter, _ *http.Request) { f.proxiesLock.Lock() defer f.proxiesLock.Unlock() ret := make([]proxy, 0) diff --git a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/tcp.go b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/tcp.go index e60936ec41..6493c94c64 100644 --- a/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/tcp.go +++ b/vendor/github.com/containers/gvisor-tap-vsock/pkg/services/forwarder/tcp.go @@ -6,13 +6,13 @@ import ( "net" "sync" + "github.com/inetaf/tcpproxy" log "github.com/sirupsen/logrus" "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/adapters/gonet" "gvisor.dev/gvisor/pkg/tcpip/stack" "gvisor.dev/gvisor/pkg/tcpip/transport/tcp" "gvisor.dev/gvisor/pkg/waiter" - "inet.af/tcpproxy" ) const linkLocalSubnet = "169.254.0.0/16" @@ -47,7 +47,7 @@ func TCP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mute } remote := tcpproxy.DialProxy{ - DialContext: func(ctx context.Context, network, address string) (net.Conn, error) { + DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { return outbound, nil }, } diff --git a/vendor/github.com/containers/gvisor-tap-vsock/pkg/sshclient/bastion.go b/vendor/github.com/containers/gvisor-tap-vsock/pkg/sshclient/bastion.go index f10bddda01..956e4f458f 100644 --- a/vendor/github.com/containers/gvisor-tap-vsock/pkg/sshclient/bastion.go +++ b/vendor/github.com/containers/gvisor-tap-vsock/pkg/sshclient/bastion.go @@ -138,7 +138,7 @@ func CreateBastion(_url *url.URL, passPhrase string, identity string, initial ne } if connect == nil { - connect = func(ctx context.Context, bastion *Bastion) (net.Conn, error) { + connect = func(_ context.Context, bastion *Bastion) (net.Conn, error) { conn, err := net.DialTimeout("tcp", net.JoinHostPort(bastion.Host, bastion.Port), bastion.Config.Timeout, diff --git a/vendor/github.com/containers/gvisor-tap-vsock/pkg/transport/dial_darwin.go b/vendor/github.com/containers/gvisor-tap-vsock/pkg/transport/dial_darwin.go index 2556a386ff..da245a4e32 100644 --- a/vendor/github.com/containers/gvisor-tap-vsock/pkg/transport/dial_darwin.go +++ b/vendor/github.com/containers/gvisor-tap-vsock/pkg/transport/dial_darwin.go @@ -6,6 +6,6 @@ import ( "github.com/pkg/errors" ) -func Dial(endpoint string) (net.Conn, string, error) { +func Dial(_ string) (net.Conn, string, error) { return nil, "", errors.New("unsupported") } diff --git a/vendor/github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork/mux.go b/vendor/github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork/mux.go index c671177caa..cc61c5d755 100644 --- a/vendor/github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork/mux.go +++ b/vendor/github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork/mux.go @@ -8,26 +8,26 @@ import ( "strconv" "github.com/containers/gvisor-tap-vsock/pkg/types" + "github.com/inetaf/tcpproxy" log "github.com/sirupsen/logrus" "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/adapters/gonet" "gvisor.dev/gvisor/pkg/tcpip/network/ipv4" - "inet.af/tcpproxy" ) func (n *VirtualNetwork) Mux() *http.ServeMux { mux := http.NewServeMux() mux.Handle("/services/", http.StripPrefix("/services", n.servicesMux)) - mux.HandleFunc("/stats", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/stats", func(w http.ResponseWriter, _ *http.Request) { _ = json.NewEncoder(w).Encode(statsAsJSON(n.networkSwitch.Sent, n.networkSwitch.Received, n.stack.Stats())) }) - mux.HandleFunc("/cam", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/cam", func(w http.ResponseWriter, _ *http.Request) { _ = json.NewEncoder(w).Encode(n.networkSwitch.CAM()) }) - mux.HandleFunc("/leases", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/leases", func(w http.ResponseWriter, _ *http.Request) { _ = json.NewEncoder(w).Encode(n.ipPool.Leases()) }) - mux.HandleFunc(types.ConnectPath, func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc(types.ConnectPath, func(w http.ResponseWriter, _ *http.Request) { hj, ok := w.(http.Hijacker) if !ok { http.Error(w, "webserver doesn't support hijacking", http.StatusInternalServerError) @@ -83,14 +83,14 @@ func (n *VirtualNetwork) Mux() *http.ServeMux { } remote := tcpproxy.DialProxy{ - DialContext: func(ctx context.Context, network, address string) (net.Conn, error) { + DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { return gonet.DialContextTCP(ctx, n.stack, tcpip.FullAddress{ NIC: 1, Addr: tcpip.AddrFrom4Slice(net.ParseIP(ip).To4()), Port: uint16(port), }, ipv4.ProtocolNumber) }, - OnDialError: func(src net.Conn, dstDialErr error) { + OnDialError: func(_ net.Conn, dstDialErr error) { log.Errorf("cannot dial: %v", dstDialErr) }, } diff --git a/vendor/inet.af/tcpproxy/.travis.yml b/vendor/github.com/inetaf/tcpproxy/.travis.yml similarity index 100% rename from vendor/inet.af/tcpproxy/.travis.yml rename to vendor/github.com/inetaf/tcpproxy/.travis.yml diff --git a/vendor/inet.af/tcpproxy/CONTRIBUTING.md b/vendor/github.com/inetaf/tcpproxy/CONTRIBUTING.md similarity index 100% rename from vendor/inet.af/tcpproxy/CONTRIBUTING.md rename to vendor/github.com/inetaf/tcpproxy/CONTRIBUTING.md diff --git a/vendor/inet.af/tcpproxy/LICENSE b/vendor/github.com/inetaf/tcpproxy/LICENSE similarity index 100% rename from vendor/inet.af/tcpproxy/LICENSE rename to vendor/github.com/inetaf/tcpproxy/LICENSE diff --git a/vendor/inet.af/tcpproxy/README.md b/vendor/github.com/inetaf/tcpproxy/README.md similarity index 59% rename from vendor/inet.af/tcpproxy/README.md rename to vendor/github.com/inetaf/tcpproxy/README.md index f526c213a9..8181ceb910 100644 --- a/vendor/inet.af/tcpproxy/README.md +++ b/vendor/github.com/inetaf/tcpproxy/README.md @@ -1,5 +1,5 @@ # tcpproxy -For library usage, see https://godoc.org/inet.af/tcpproxy/ +For library usage, see https://pkg.go.dev/github.com/inetaf/tcpproxy/ For CLI usage, see https://github.com/inetaf/tcpproxy/blob/master/cmd/tlsrouter/README.md diff --git a/vendor/inet.af/tcpproxy/http.go b/vendor/github.com/inetaf/tcpproxy/http.go similarity index 100% rename from vendor/inet.af/tcpproxy/http.go rename to vendor/github.com/inetaf/tcpproxy/http.go diff --git a/vendor/inet.af/tcpproxy/listener.go b/vendor/github.com/inetaf/tcpproxy/listener.go similarity index 100% rename from vendor/inet.af/tcpproxy/listener.go rename to vendor/github.com/inetaf/tcpproxy/listener.go diff --git a/vendor/inet.af/tcpproxy/sni.go b/vendor/github.com/inetaf/tcpproxy/sni.go similarity index 100% rename from vendor/inet.af/tcpproxy/sni.go rename to vendor/github.com/inetaf/tcpproxy/sni.go diff --git a/vendor/inet.af/tcpproxy/tcpproxy.go b/vendor/github.com/inetaf/tcpproxy/tcpproxy.go similarity index 100% rename from vendor/inet.af/tcpproxy/tcpproxy.go rename to vendor/github.com/inetaf/tcpproxy/tcpproxy.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 01ba8f8597..1edaada918 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -89,7 +89,7 @@ github.com/cloudflare/circl/math/mlsbset github.com/cloudflare/circl/sign github.com/cloudflare/circl/sign/ed25519 github.com/cloudflare/circl/sign/ed448 -# github.com/containers/gvisor-tap-vsock v0.7.3 +# github.com/containers/gvisor-tap-vsock v0.7.4-0.20240320091526-a0238e52b61f ## explicit; go 1.20 github.com/containers/gvisor-tap-vsock/pkg/client github.com/containers/gvisor-tap-vsock/pkg/fs @@ -433,6 +433,9 @@ github.com/imdario/mergo # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap +# github.com/inetaf/tcpproxy v0.0.0-20240214030015-3ce58045626c +## explicit; go 1.16 +github.com/inetaf/tcpproxy # github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f ## explicit; go 1.13 github.com/insomniacslk/dhcp/dhcpv4 @@ -1081,9 +1084,6 @@ gvisor.dev/gvisor/pkg/tcpip/transport/tcp gvisor.dev/gvisor/pkg/tcpip/transport/tcpconntrack gvisor.dev/gvisor/pkg/tcpip/transport/udp gvisor.dev/gvisor/pkg/waiter -# inet.af/tcpproxy v0.0.0-20231102063150-2862066fc2a9 -## explicit; go 1.16 -inet.af/tcpproxy # k8s.io/api v0.28.8 ## explicit; go 1.20 k8s.io/api/admissionregistration/v1