Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to go1.19 #9227

Merged
merged 18 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '*'

env:
GO_VERSION: 1.17
GO_VERSION: 1.19
CGO_ENABLED: 0
IN_DOCKER: ""

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '*'

env:
GO_VERSION: 1.17
GO_VERSION: 1.19
IN_DOCKER: ""

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- '*'

env:
GO_VERSION: 1.17
GOLANGCI_LINT_VERSION: v1.47.1
GO_VERSION: 1.19
GOLANGCI_LINT_VERSION: v1.48.0
MISSSPELL_VERSION: v0.3.4
IN_DOCKER: ""

Expand Down
17 changes: 7 additions & 10 deletions .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"interfacer", # Deprecated
"maligned", # Deprecated
"golint", # Deprecated
"nosnakecase", # Deprecated
"execinquery", # Not relevant (SQL)
"sqlclosecheck", # Not relevant (SQL)
"rowserrcheck", # Not relevant (SQL)
Expand Down Expand Up @@ -159,6 +160,7 @@
"containedctx", # too many false-positive
"maintidx", # kind of duplicate of gocyclo
"nonamedreturns", # not relevant
"structcheck", # duplicate of unused
]

[issues]
Expand Down Expand Up @@ -223,14 +225,9 @@
path = "pkg/server/router/tcp/manager.go"
text = "Function 'buildEntryPointHandler' is too long (.+)"
[[issues.exclude-rules]]
path = "integration/fake_dns_server.go"
linters = ["nosnakecase"]
path = "pkg/tls/tlsmanager_test.go"
text = "SA1019: config.ClientCAs.Subjects has been deprecated since Go 1.18"
[[issues.exclude-rules]]
path = "pkg/plugins/providers.go"
linters = ["nosnakecase"]
[[issues.exclude-rules]]
path = "pkg/tls/cipher.go"
linters = ["nosnakecase"]
[[issues.exclude-rules]]
text = "O_WRONLY|O_RDWR|O_CREATE|O_TRUNC|O_APPEND"
linters = ["nosnakecase"]
path = "pkg/types/tls_test.go"
text = "SA1019: tlsConfig.RootCAs.Subjects has been deprecated since Go 1.18"

4 changes: 2 additions & 2 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ global_job_config:
prologue:
commands:
- curl -sSfL https://raw.githubusercontent.com/ldez/semgo/master/godownloader.sh | sudo sh -s -- -b "/usr/local/bin"
- sudo semgo go1.17
- sudo semgo go1.19
- export "GOPATH=$(go env GOPATH)"
- export "SEMAPHORE_GIT_DIR=${GOPATH}/src/github.com/traefik/${SEMAPHORE_PROJECT_NAME}"
- export "PATH=${GOPATH}/bin:${PATH}"
- mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin"
- export GOPROXY=https://proxy.golang.org,direct
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.46.2
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.48.0
- curl -sSfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | bash -s -- -b "${GOPATH}/bin"
- checkout
- cache restore traefik-$(checksum go.sum)
Expand Down
4 changes: 2 additions & 2 deletions build.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine
FROM golang:1.19-alpine

RUN apk --no-cache --no-progress add git mercurial bash gcc musl-dev curl tar ca-certificates tzdata \
&& update-ca-certificates \
Expand All @@ -13,7 +13,7 @@ RUN mkdir -p /usr/local/bin \
| tar -xzC /usr/local/bin --transform 's#^.+/##x'

# Download golangci-lint binary to bin folder in $GOPATH
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.47.1
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.48.0

# Download misspell binary to bin folder in $GOPATH
RUN curl -sfL https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.3.4
Expand Down
33 changes: 0 additions & 33 deletions docs/content/https/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,39 +396,6 @@ spec:
sniStrict: true
```

### Prefer Server Cipher Suites

This option allows the server to choose its most preferred cipher suite instead of the client's.
Please note that this is enabled automatically when `minVersion` or `maxVersion` are set.

```yaml tab="File (YAML)"
# Dynamic configuration

tls:
options:
default:
preferServerCipherSuites: true
```

```toml tab="File (TOML)"
# Dynamic configuration

[tls.options]
[tls.options.default]
preferServerCipherSuites = true
```

```yaml tab="Kubernetes"
apiVersion: traefik.containo.us/v1alpha1
kind: TLSOption
metadata:
name: default
namespace: default

spec:
preferServerCipherSuites: true
```

### ALPN Protocols

_Optional, Default="h2, http/1.1, acme-tls/1"_
Expand Down
7 changes: 7 additions & 0 deletions docs/content/migration/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,10 @@ In `v2.8`, the `namespace` option of Consul and Consul Catalog providers is depr

In `v2.8`, the `pilot.token` and `pilot.dashboard` options are deprecated.
Please check our Blog for migration instructions later this year.

## v2.8.2

Since `v2.5.0`, the `PreferServerCipherSuites` is [deprecated and ignored](https://tip.golang.org/doc/go1.17#crypto/tls) by Go,
in `v2.8.2` the `preferServerCipherSuites` option is also deprecated and ignored in Traefik.

In `v2.8.2`, Traefik now reject certificates signed with the SHA-1 hash function. ([details](https://tip.golang.org/doc/go1.18#sha1))
Original file line number Diff line number Diff line change
Expand Up @@ -1783,9 +1783,10 @@ spec:
VersionTLS13. Default: VersionTLS10.'
type: string
preferServerCipherSuites:
description: PreferServerCipherSuites defines whether the server chooses
a cipher suite among his own instead of among the client's. It is
enabled automatically when minVersion or maxVersion are set.
description: 'PreferServerCipherSuites defines whether the server
chooses a cipher suite among his own instead of among the client''s.
It is enabled automatically when minVersion or maxVersion is set.
Deprecated: https://github.com/golang/go/issues/45430'
type: boolean
sniStrict:
description: SniStrict defines whether Traefik allows connections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ spec:
VersionTLS13. Default: VersionTLS10.'
type: string
preferServerCipherSuites:
description: PreferServerCipherSuites defines whether the server chooses
a cipher suite among his own instead of among the client's. It is
enabled automatically when minVersion or maxVersion are set.
description: 'PreferServerCipherSuites defines whether the server
chooses a cipher suite among his own instead of among the client''s.
It is enabled automatically when minVersion or maxVersion is set.
Deprecated: https://github.com/golang/go/issues/45430'
type: boolean
sniStrict:
description: SniStrict defines whether Traefik allows connections
Expand Down
2 changes: 1 addition & 1 deletion exp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN yarn install
RUN yarn build

# BUILD
FROM golang:1.17-alpine as gobuild
FROM golang:1.19-alpine as gobuild

RUN apk --no-cache --no-progress add git mercurial bash gcc musl-dev curl tar ca-certificates tzdata \
&& update-ca-certificates \
Expand Down
15 changes: 8 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/traefik/traefik/v2

go 1.17
go 1.19

require (
github.com/BurntSushi/toml v1.1.0
Expand Down Expand Up @@ -37,7 +37,7 @@ require (
github.com/instana/go-sensor v1.38.3
github.com/klauspost/compress v1.14.2
github.com/kvtools/valkeyrie v0.4.1
github.com/lucas-clemente/quic-go v0.27.0
github.com/lucas-clemente/quic-go v0.28.1
github.com/mailgun/ttlmap v0.0.0-20170619185759-c1c17f74874f
github.com/miekg/dns v1.1.47
github.com/mitchellh/copystructure v1.0.0
Expand All @@ -56,7 +56,7 @@ require (
github.com/stretchr/testify v1.8.0
github.com/stvp/go-udp-testing v0.0.0-20191102171040-06b61409b154
github.com/traefik/paerser v0.1.6
github.com/traefik/yaegi v0.13.0
github.com/traefik/yaegi v0.14.1
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/uber/jaeger-lib v2.2.0+incompatible
github.com/unrolled/render v1.0.2
Expand All @@ -67,7 +67,8 @@ require (
go.elastic.co/apm v1.13.1
go.elastic.co/apm/module/apmot v1.13.1
golang.org/x/mod v0.4.2
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
golang.org/x/text v0.3.7
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2
google.golang.org/grpc v1.38.0
Expand Down Expand Up @@ -227,8 +228,9 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/marten-seemann/qpack v0.2.1 // indirect
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.1 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect
github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1 // indirect
github.com/mattn/go-colorable v0.1.11 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
Expand Down Expand Up @@ -311,7 +313,6 @@ require (
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.44.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
Loading