TUN-6917: Bump go to 1.19.3
This commit is contained in:
parent
1b5313cc28
commit
515ad7cbee
8
Makefile
8
Makefile
|
@ -297,8 +297,8 @@ quic-deps:
|
||||||
|
|
||||||
.PHONY: vet
|
.PHONY: vet
|
||||||
vet:
|
vet:
|
||||||
go vet -v -mod=vendor ./...
|
go vet -v -mod=vendor github.com/cloudflare/cloudflared/...
|
||||||
|
|
||||||
.PHONY: goimports
|
.PHONY: fmt
|
||||||
goimports:
|
fmt:
|
||||||
for d in $$(go list -mod=readonly -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc) ; do goimports -format-only -local github.com/cloudflare/cloudflared -w $$d ; done
|
goimports -l -w -local github.com/cloudflare/cloudflared $$(go list -mod=vendor -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc)
|
||||||
|
|
29
cfsetup.yaml
29
cfsetup.yaml
|
@ -1,23 +1,29 @@
|
||||||
pinned_go: &pinned_go go=1.18.6-1
|
pinned_go: &pinned_go go=1.19.3-1
|
||||||
pinned_go_fips: &pinned_go_fips go-boring=1.18.6-1
|
pinned_go_fips: &pinned_go_fips go-boring=1.19.3-1
|
||||||
|
|
||||||
build_dir: &build_dir /cfsetup_build
|
build_dir: &build_dir /cfsetup_build
|
||||||
default-flavor: bullseye
|
default-flavor: bullseye
|
||||||
stretch: &stretch
|
stretch: &stretch
|
||||||
build:
|
build:
|
||||||
build_dir: *build_dir
|
build_dir: *build_dir
|
||||||
builddeps:
|
builddeps: &build_deps
|
||||||
- *pinned_go
|
- *pinned_go
|
||||||
- build-essential
|
- build-essential
|
||||||
|
- gotest-to-teamcity
|
||||||
|
pre-cache: &build_pre_cache
|
||||||
|
- export GOCACHE=/cfsetup_build/.cache/go-build
|
||||||
|
- go install golang.org/x/tools/cmd/goimports@latest
|
||||||
post-cache:
|
post-cache:
|
||||||
- export GOOS=linux
|
- export GOOS=linux
|
||||||
- export GOARCH=amd64
|
- export GOARCH=amd64
|
||||||
- make cloudflared
|
- make cloudflared
|
||||||
build-fips:
|
build-fips:
|
||||||
build_dir: *build_dir
|
build_dir: *build_dir
|
||||||
builddeps:
|
builddeps: &build_deps_fips
|
||||||
- *pinned_go_fips
|
- *pinned_go_fips
|
||||||
- build-essential
|
- build-essential
|
||||||
|
- gotest-to-teamcity
|
||||||
|
pre-cache: *build_pre_cache
|
||||||
post-cache:
|
post-cache:
|
||||||
- export GOOS=linux
|
- export GOOS=linux
|
||||||
- export GOARCH=amd64
|
- export GOARCH=amd64
|
||||||
|
@ -163,12 +169,8 @@ stretch: &stretch
|
||||||
- make github-windows-upload
|
- make github-windows-upload
|
||||||
test:
|
test:
|
||||||
build_dir: *build_dir
|
build_dir: *build_dir
|
||||||
builddeps:
|
builddeps: *build_deps
|
||||||
- *pinned_go
|
pre-cache: *build_pre_cache
|
||||||
- build-essential
|
|
||||||
- gotest-to-teamcity
|
|
||||||
pre-cache: &test_pre_cache
|
|
||||||
- go install golang.org/x/tools/cmd/goimports@latest
|
|
||||||
post-cache:
|
post-cache:
|
||||||
- export GOOS=linux
|
- export GOOS=linux
|
||||||
- export GOARCH=amd64
|
- export GOARCH=amd64
|
||||||
|
@ -177,11 +179,8 @@ stretch: &stretch
|
||||||
- make test | gotest-to-teamcity
|
- make test | gotest-to-teamcity
|
||||||
test-fips:
|
test-fips:
|
||||||
build_dir: *build_dir
|
build_dir: *build_dir
|
||||||
builddeps:
|
builddeps: *build_deps_fips
|
||||||
- *pinned_go_fips
|
pre-cache: *build_pre_cache
|
||||||
- build-essential
|
|
||||||
- gotest-to-teamcity
|
|
||||||
pre-cache: *test_pre_cache
|
|
||||||
post-cache:
|
post-cache:
|
||||||
- export GOOS=linux
|
- export GOOS=linux
|
||||||
- export GOARCH=amd64
|
- export GOARCH=amd64
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.18 as builder
|
FROM golang:1.19 as builder
|
||||||
ENV GO111MODULE=on \
|
ENV GO111MODULE=on \
|
||||||
CGO_ENABLED=0
|
CGO_ENABLED=0
|
||||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||||
|
|
|
@ -73,9 +73,12 @@ type EdgeAddr struct {
|
||||||
// Note: Instead of DoT, we could also have used DoH. Either of these:
|
// Note: Instead of DoT, we could also have used DoH. Either of these:
|
||||||
// - directly via the JSON API (https://1.1.1.1/dns-query?ct=application/dns-json&name=_origintunneld._tcp.argotunnel.com&type=srv)
|
// - directly via the JSON API (https://1.1.1.1/dns-query?ct=application/dns-json&name=_origintunneld._tcp.argotunnel.com&type=srv)
|
||||||
// - indirectly via `tunneldns.NewUpstreamHTTPS()`
|
// - indirectly via `tunneldns.NewUpstreamHTTPS()`
|
||||||
|
//
|
||||||
// But both of these cases miss out on a key feature from the stdlib:
|
// But both of these cases miss out on a key feature from the stdlib:
|
||||||
|
//
|
||||||
// "The returned records are sorted by priority and randomized by weight within a priority."
|
// "The returned records are sorted by priority and randomized by weight within a priority."
|
||||||
// (https://golang.org/pkg/net/#Resolver.LookupSRV)
|
// (https://golang.org/pkg/net/#Resolver.LookupSRV)
|
||||||
|
//
|
||||||
// Does this matter? I don't know. It may someday. Let's use DoT so we don't need to worry about it.
|
// Does this matter? I don't know. It may someday. Let's use DoT so we don't need to worry about it.
|
||||||
// See also: Go feature request for stdlib-supported DoH: https://github.com/golang/go/issues/27552
|
// See also: Go feature request for stdlib-supported DoH: https://github.com/golang/go/issues/27552
|
||||||
var fallbackLookupSRV = lookupSRVWithDOT
|
var fallbackLookupSRV = lookupSRVWithDOT
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
set -e -o pipefail
|
set -e -o pipefail
|
||||||
|
|
||||||
OUTPUT=$(for d in $(go list -mod=vendor -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc) ; do goimports -format-only -local github.com/cloudflare/cloudflared -d $d ; done)
|
OUTPUT=$(goimports -l -d -local github.com/cloudflare/cloudflared $(go list -mod=vendor -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc))
|
||||||
|
|
||||||
if [ -n "$OUTPUT" ] ; then
|
if [ -n "$OUTPUT" ] ; then
|
||||||
PAGER=$(which colordiff || echo cat)
|
PAGER=$(which colordiff || echo cat)
|
||||||
echo
|
echo
|
||||||
echo "Code formatting issues found, use 'goimports -format-only -local github.com/cloudflare/cloudflared' to correct them"
|
echo "Code formatting issues found, use 'make fmt' to correct them"
|
||||||
echo
|
echo
|
||||||
echo "$OUTPUT" | $PAGER
|
echo "$OUTPUT" | $PAGER
|
||||||
exit 1
|
exit 1
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
||||||
module github.com/cloudflare/cloudflared
|
module github.com/cloudflare/cloudflared
|
||||||
|
|
||||||
go 1.18
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/cloudflare/brotli-go v0.0.0-20191101163834-d34379f7ff93
|
github.com/cloudflare/brotli-go v0.0.0-20191101163834-d34379f7ff93
|
||||||
|
|
|
@ -439,6 +439,7 @@ func (defaults *OriginRequestConfig) setAccess(overrides config.OriginRequestCon
|
||||||
// 2. The user config for the overall ingress config
|
// 2. The user config for the overall ingress config
|
||||||
// 3. Defaults chosen by the cloudflared team
|
// 3. Defaults chosen by the cloudflared team
|
||||||
// 4. Golang zero values for that type
|
// 4. Golang zero values for that type
|
||||||
|
//
|
||||||
// If an earlier option isn't set, it will try the next option down.
|
// If an earlier option isn't set, it will try the next option down.
|
||||||
func setConfig(defaults OriginRequestConfig, overrides config.OriginRequestConfig) OriginRequestConfig {
|
func setConfig(defaults OriginRequestConfig, overrides config.OriginRequestConfig) OriginRequestConfig {
|
||||||
cfg := defaults
|
cfg := defaults
|
||||||
|
|
|
@ -40,7 +40,6 @@ func (ar AuthenticateResponse) Outcome() AuthOutcome {
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthOutcome is a programmer-friendly sum type denoting the possible outcomes of Authenticate.
|
// AuthOutcome is a programmer-friendly sum type denoting the possible outcomes of Authenticate.
|
||||||
//go-sumtype:decl AuthOutcome
|
|
||||||
type AuthOutcome interface {
|
type AuthOutcome interface {
|
||||||
isAuthOutcome()
|
isAuthOutcome()
|
||||||
// Serialize into an AuthenticateResponse which can be sent via Capnp
|
// Serialize into an AuthenticateResponse which can be sent via Capnp
|
||||||
|
|
|
@ -61,9 +61,13 @@ func ValidateHostname(hostname string) (string, error) {
|
||||||
|
|
||||||
// ValidateUrl returns a validated version of `originUrl` with a scheme prepended (by default http://).
|
// ValidateUrl returns a validated version of `originUrl` with a scheme prepended (by default http://).
|
||||||
// Note: when originUrl contains a scheme, the path is removed:
|
// Note: when originUrl contains a scheme, the path is removed:
|
||||||
|
//
|
||||||
// ValidateUrl("https://localhost:8080/api/") => "https://localhost:8080"
|
// ValidateUrl("https://localhost:8080/api/") => "https://localhost:8080"
|
||||||
|
//
|
||||||
// but when it does not, the path is preserved:
|
// but when it does not, the path is preserved:
|
||||||
|
//
|
||||||
// ValidateUrl("localhost:8080/api/") => "http://localhost:8080/api/"
|
// ValidateUrl("localhost:8080/api/") => "http://localhost:8080/api/"
|
||||||
|
//
|
||||||
// This is arguably a bug, but changing it might break some cloudflared users.
|
// This is arguably a bug, but changing it might break some cloudflared users.
|
||||||
func ValidateUrl(originUrl string) (*url.URL, error) {
|
func ValidateUrl(originUrl string) (*url.URL, error) {
|
||||||
urlStr, err := validateUrlString(originUrl)
|
urlStr, err := validateUrlString(originUrl)
|
||||||
|
|
Loading…
Reference in New Issue