Skip to content

Commit

Permalink
Merge pull request #381 from kinvolk/imran/go-mod-update
Browse files Browse the repository at this point in the history
update go modules
  • Loading branch information
k8s-ci-robot authored Sep 2, 2022
2 parents 0c96dd5 + 04595aa commit 85e1558
Show file tree
Hide file tree
Showing 9 changed files with 475 additions and 58 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ endif
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
INSTALL_LOCATION:=$(shell go env GOPATH)/bin
GOLANGCI_LINT_VERSION ?= 1.35.2
GOSEC_VERSION ?= 2.5.0
GOLANGCI_LINT_VERSION ?= 1.45.2
GOSEC_VERSION ?= 2.13.1

REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
STAGING_REGISTRY := gcr.io/k8s-staging-kas-network-proxy
Expand Down
2 changes: 1 addition & 1 deletion artifacts/images/agent-build.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the proxy-agent binary
FROM golang:1.17.12 as builder
FROM golang:1.18.5 as builder

# Copy in the go src
WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
Expand Down
2 changes: 1 addition & 1 deletion artifacts/images/server-build.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the proxy-server binary
FROM golang:1.17.12 as builder
FROM golang:1.18.5 as builder

# Copy in the go src
WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
Expand Down
17 changes: 11 additions & 6 deletions cmd/agent/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http/pprof"
"runtime"
"strconv"
"time"

"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"
Expand All @@ -20,6 +21,8 @@ import (
"sigs.k8s.io/apiserver-network-proxy/pkg/util"
)

const ReadHeaderTimeout = 60 * time.Second

func NewAgentCommand(a *Agent, o *options.GrpcProxyAgentOptions) *cobra.Command {
cmd := &cobra.Command{
Use: "agent",
Expand Down Expand Up @@ -94,9 +97,10 @@ func (a *Agent) runHealthServer(o *options.GrpcProxyAgentOptions) error {
muxHandler.HandleFunc("/ready", readinessHandler)
muxHandler.HandleFunc("/readyz", readinessHandler)
healthServer := &http.Server{
Addr: net.JoinHostPort(o.HealthServerHost, strconv.Itoa(o.HealthServerPort)),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
Addr: net.JoinHostPort(o.HealthServerHost, strconv.Itoa(o.HealthServerPort)),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
ReadHeaderTimeout: ReadHeaderTimeout,
}

go func() {
Expand Down Expand Up @@ -130,9 +134,10 @@ func (a *Agent) runAdminServer(o *options.GrpcProxyAgentOptions) error {
}

adminServer := &http.Server{
Addr: fmt.Sprintf("127.0.0.1:%d", o.AdminServerPort),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
Addr: fmt.Sprintf("127.0.0.1:%d", o.AdminServerPort),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
ReadHeaderTimeout: ReadHeaderTimeout,
}

go func() {
Expand Down
17 changes: 11 additions & 6 deletions cmd/server/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import (

var udsListenerLock sync.Mutex

const ReadHeaderTimeout = 60 * time.Second

func NewProxyCommand(p *Proxy, o *options.ProxyRunOptions) *cobra.Command {
cmd := &cobra.Command{
Use: "proxy",
Expand Down Expand Up @@ -201,6 +203,7 @@ func (p *Proxy) runUDSFrontendServer(ctx context.Context, o *options.ProxyRunOpt
} else {
// http-connect
server := &http.Server{
ReadHeaderTimeout: ReadHeaderTimeout,
Handler: &server.Tunnel{
Server: s,
},
Expand Down Expand Up @@ -288,8 +291,9 @@ func (p *Proxy) runMTLSFrontendServer(ctx context.Context, o *options.ProxyRunOp
} else {
// http-connect
server := &http.Server{
Addr: addr,
TLSConfig: tlsConfig,
ReadHeaderTimeout: ReadHeaderTimeout,
Addr: addr,
TLSConfig: tlsConfig,
Handler: &server.Tunnel{
Server: s,
},
Expand Down Expand Up @@ -350,7 +354,7 @@ func (p *Proxy) runAdminServer(o *options.ProxyRunOptions, server *server.ProxyS
}
}
adminServer := &http.Server{
Addr: net.JoinHostPort(o.AdminBindAddress, strconv.Itoa(o.AdminPort)),
Addr: fmt.Sprintf("127.0.0.1:%d", o.AdminPort),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
}
Expand Down Expand Up @@ -387,9 +391,10 @@ func (p *Proxy) runHealthServer(o *options.ProxyRunOptions, server *server.Proxy
muxHandler.HandleFunc("/ready", readinessHandler)
muxHandler.HandleFunc("/readyz", readinessHandler)
healthServer := &http.Server{
Addr: net.JoinHostPort(o.HealthBindAddress, strconv.Itoa(o.HealthPort)),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
Addr: net.JoinHostPort(o.HealthBindAddress, strconv.Itoa(o.HealthPort)),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
ReadHeaderTimeout: ReadHeaderTimeout,
}

go func() {
Expand Down
7 changes: 4 additions & 3 deletions cmd/test-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ func (p *TestServer) runTestServer(ctx context.Context, o *TestServerRunOptions)
muxHandler.HandleFunc("/error", returnError)
muxHandler.HandleFunc("/close", closeNoResponse)
server := &http.Server{
Addr: fmt.Sprintf("127.0.0.1:%d", o.serverPort),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
Addr: fmt.Sprintf("127.0.0.1:%d", o.serverPort),
Handler: muxHandler,
MaxHeaderBytes: 1 << 20,
ReadHeaderTimeout: 60 * time.Second,
}

go func() {
Expand Down
92 changes: 53 additions & 39 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,60 +1,74 @@
module sigs.k8s.io/apiserver-network-proxy

go 1.17
go 1.18

require (
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.4.3
github.com/google/uuid v1.1.2
github.com/prometheus/client_golang v1.7.1
github.com/spf13/cobra v0.0.3
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.3.0
github.com/prometheus/client_golang v1.13.0
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
google.golang.org/grpc v1.42.0
k8s.io/api v0.20.10
k8s.io/apimachinery v0.20.10
k8s.io/client-go v0.20.10
k8s.io/component-base v0.20.10
k8s.io/klog/v2 v2.4.0
golang.org/x/net v0.0.0-20220812174116-3211cb980234
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.1
k8s.io/api v0.24.3
k8s.io/apimachinery v0.24.3
k8s.io/client-go v0.24.3
k8s.io/component-base v0.24.3
k8s.io/klog/v2 v2.70.1
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.0
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
github.com/go-logr/logr v0.2.0 // indirect
github.com/emicklei/go-restful v2.16.0+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.22.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.4.1 // indirect
github.com/imdario/mergo v0.3.5 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
go.uber.org/goleak v1.1.10 // indirect
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd // indirect
golang.org/x/text v0.3.4 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
golang.org/x/tools v0.1.10 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220812140447-cec7f5303424 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea // indirect
k8s.io/utils v0.0.0-20220812165043-ad590609e2e5 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace sigs.k8s.io/apiserver-network-proxy/konnectivity-client => ./konnectivity-client
Loading

0 comments on commit 85e1558

Please sign in to comment.